Search code examples
eclipsepluginseclipse-plugin

Eclipse Plugin Development Default Key Bindings: What are the key codes for special keys (Shift, Alt, etc.)?


I'm developing an Eclipse plugin and therefore defining some key bindings. From this resource I know that the control key is denoted by the code M1.

Where can I find a table that maps all special keys to their key code, in particular Shift, Alt, Caps Lock and Enter?


Solution

  • From the documentation:

    The recognized modifiers keys are M1, M2, M3, M4, ALT, COMMAND, CTRL, and SHIFT. The "M" modifier keys are a platform-independent way of representing keys, and these are generally preferred. M1 is the COMMAND key on MacOS X, and the CTRL key on most other platforms. M2 is the SHIFT key. M3 is the Option key on MacOS X, and the ALT key on most other platforms. M4 is the CTRL key on MacOS X, and is undefined on other platforms.