void () { int[] allowedModifiers = new int[]{ 0, InputEvent.SHIFT_MASK, InputEvent.CTRL_MASK, InputEvent.META_MASK, InputEvent.ALT_MASK }; ShortcutSet selectShortcuts = ActionManager.getInstance().getAction(SearchEverywhereActions.SELECT_ITEM).getShortcutSet(); Collection<KeyboardShortcut> keyboardShortcuts = ContainerUtil.filterIsInstance(selectShortcuts.getShortcuts(), KeyboardShortcut.class); for (int modifiers : allowedModifiers) { Collection<Shortcut> newShortcuts = new ArrayList<>(); for (KeyboardShortcut shortcut : keyboardShortcuts) { boolean hasSecondStroke = shortcut.getSecondKeyStroke() != null; KeyStroke originalStroke = hasSecondStroke ? shortcut.getSecondKeyStroke() : shortcut.getFirstKeyStroke(); if ((originalStroke.getModifiers() & modifiers) != 0) continue; KeyStroke newStroke = KeyStroke.getKeyStroke(originalStroke.getKeyCode(), originalStroke.getModifiers() | modifiers); newShortcuts.add(hasSecondStroke ? new KeyboardShortcut(shortcut.getFirstKeyStroke(), newStroke) : new KeyboardShortcut(newStroke, null)); } if (newShortcuts.isEmpty()) continue; ShortcutSet newShortcutSet = new CustomShortcutSet(newShortcuts.toArray(Shortcut.EMPTY_ARRAY)); DumbAwareAction.create(event -> { int[] indices = myResultsList.getSelectedIndices(); elementsSelected(indices, modifiers); }).registerCustomShortcutSet(newShortcutSet, this, this); } }