What happens when multiple plugins register a custom shortcut to the same component?
What happens when two actions register the same custom shortcut to a component (say the editor) via AnAction.registerCustomShortcutSet()? IdeaVIM has registered a shortcut via this method that I want to steal. Unfortunately, IdeKeyEventDispatcher only notifies the first registered action whose presentation is enabled. How do I get the dispatcher to call my action?
Please sign in to leave a comment.
In case anyone is interested, I figured out how to hijack the keystrokes from another plugin that has registered a custom shortcut to a component via AnAction.registerCustomShortcutSet(). You need to use a special key called ACTIONS_KEY together with JComponent.putClientProperty() - there is a special utility class in the IntelliJ Platform API that will also do this for you. Remember to save the original list of AnAction that ws bound to a component, so you can restore it when you're finished.
Maybe com.intellij.openapi.actionSystem.ActionPromoter can help.