Search code examples
sublimetext2sublimetext

Can Sublime plugin handle keys pressing, and key up/down?


Can Sublime Text plugins handle event of

  • key press (handle any key combination pressed, e.g. Ctrl+Alt+F1)
  • key up/down (handle pressing of keys, and then releasing of keys)

If yes, how can my plugin handle these?


Solution

  • Yes -- using key bindings, which can be assigned in yourplugin/Default (platform).sublime-keymap.

    You can also assign/customize global User Bindings (e.g. keyboard or mouse shortcuts) by creating (or modifying the existing) Default.sublime-keymap file in your Packages/User/ directory.