Search code examples
intellij-ideaintellij-pluginkeymapping

Intellij plugin keymap first-stroke value


I have implemented a plugin that I would now like to use. However, I do not understand and did not see clear documentation on how to assign keyboard shortcuts. I would like to activate it on a alt + enter key combination, but its not obvious what my keyboard-shortcut entry should be.

<keyboard-shortcut keymap="Mac OS X" first-keystroke="???"/>

I have the "Mac OS X" keymap set in preferences.


Solution

  • The shortcut for Alt-Enter is written as "alt ENTER". You can look at the default keymaps as an example for defining other keyboard shortcuts.

    Note that Alt-Enter is already used by the quickfix menu in IntelliJ IDEA, so it may not be a good idea to use the same shortcut for your own action. If you want to extend the Alt-Enter menu, there are other mechanisms for that (intention actions).