Home Download Buy Blog Forum Support

Detect key events

Detect key events

Postby hasofanten on Fri Oct 11, 2013 8:32 pm

Hello everyone!

I have been searching for a way to detect when a key is pressed/released. I would like to develop a plugin that use the capslock key but it dosn't seem possible to detect the state of the key.

My idea for the plugin is the following:
When you press (and hold down) the capslock key you enter a simple search mode.
When in this mode you can then type a string to search after, much like the normal search function already in Sublime.
After that you release the capslock key and you exit the simple search mode.

If you now click capslock again (both push/release) then the plugin will perform an incremental search using the same string as entered last time it was used.

If you use shift as a modifier it will do the same thing (for both cases) only it will search backwards instead.

This plugin is meant to be used to navigate text quickly, and it wont show any dialog boxes or input fields and such.

Does anyone know if it is even possible to develop such a plugin for Sublime?

/Hasofanten
hasofanten
 
Posts: 2
Joined: Fri Oct 11, 2013 8:20 pm

Re: Detect key events

Postby adzenith on Mon Oct 14, 2013 3:30 pm

I believe this is impossible using Sublime Text's API. You might be able to use AutoHotKey or something, though.
adzenith
 
Posts: 1213
Joined: Mon Oct 19, 2009 9:12 pm

Re: Detect key events

Postby hasofanten on Mon Oct 14, 2013 6:54 pm

adzenith wrote:I believe this is impossible using Sublime Text's API. You might be able to use AutoHotKey or something, though.


Ok, thanks for your answer.
hasofanten
 
Posts: 2
Joined: Fri Oct 11, 2013 8:20 pm


Return to Plugin Development

Who is online

Users browsing this forum: No registered users and 6 guests