int (@NotNull String toolWindowId) { Keymap activeKeymap = KeymapManager.getInstance().getActiveKeymap(); for (Shortcut shortcut : activeKeymap.getShortcuts(getActionIdForToolWindow(toolWindowId))) { if (!(shortcut instanceof KeyboardShortcut)) { continue; } KeyStroke keyStroke = ((KeyboardShortcut)shortcut).getFirstKeyStroke(); int modifiers = keyStroke.getModifiers(); if (modifiers == (InputEvent.ALT_DOWN_MASK | InputEvent.ALT_MASK) || modifiers == InputEvent.ALT_MASK || modifiers == InputEvent.ALT_DOWN_MASK || modifiers == (InputEvent.META_DOWN_MASK | InputEvent.META_MASK) || modifiers == InputEvent.META_MASK || modifiers == InputEvent.META_DOWN_MASK) { int keyCode = keyStroke.getKeyCode(); if (KeyEvent.VK_0 <= keyCode && keyCode <= KeyEvent.VK_9) { return (char)('0' + keyCode - KeyEvent.VK_0); } } } return -1; }