@Override protected void processKeyEvent(KeyEvent e) { if (e.getID() == KeyEvent.KEY_PRESSED) { int keyCode = e.getKeyCode(); if ( keyCode == KeyEvent.VK_SHIFT || keyCode == KeyEvent.VK_ALT || keyCode == KeyEvent.VK_CONTROL || keyCode == KeyEvent.VK_ALT_GRAPH || keyCode == KeyEvent.VK_META ){ return; } setKeyStroke(KeyStrokeAdapter.getDefaultKeyStroke(e)); } }
protected void processKeyEvent(KeyEvent e) { if (e.getID() == KeyEvent.KEY_PRESSED) { int keyCode = e.getKeyCode(); if ( keyCode == KeyEvent.VK_SHIFT || keyCode == KeyEvent.VK_ALT || keyCode == KeyEvent.VK_CONTROL || keyCode == KeyEvent.VK_ALT_GRAPH || keyCode == KeyEvent.VK_META ){ return; } setKeyStroke(KeyStrokeAdapter.getDefaultKeyStroke(e)); } }
@NotNull private static String getLabel() { Shortcut[] shortcuts = KeymapManager.getInstance().getActiveKeymap().getShortcuts("EditSource"); if (shortcuts.length > 0) { Shortcut shortcut = shortcuts[0]; if (shortcut.isKeyboard()) { KeyboardShortcut key = (KeyboardShortcut) shortcut; String s = KeyStrokeAdapter.toString(key.getFirstKeyStroke()); if (s != null) { return "Jump To Source [" + s.toUpperCase() + "]"; } } } return "Jump To Source"; }
/** * @return string representation of passed keystroke. */ public static String getKeyShortcutString(KeyStroke keyStroke) { return KeyStrokeAdapter.toString(keyStroke); }