Home Download Buy Blog Forum Support

Keystroke detection

Keystroke detection

Postby shercoder on Mon Jan 14, 2013 2:37 am

I am trying to build my first plugin. I was wondering if API provides a functionality that would help me detect keystrokes. For example, if user is typing code, I need to get the updates of what they're typing (characters they're typing and their locations).

Any help would be awesome.

Thank you
shercoder
 
Posts: 2
Joined: Mon Jan 14, 2013 2:34 am

Re: Keystroke detection

Postby C0D312 on Mon Jan 14, 2013 3:31 am

Look into on_modified or on_query_context: viewtopic.php?f=6&t=10033
C0D312
 
Posts: 1063
Joined: Sun Jul 10, 2011 3:23 am

Re: Keystroke detection

Postby shercoder on Wed Jan 16, 2013 5:40 am

C0D312 wrote:Look into on_modified or on_query_context: viewtopic.php?f=6&t=10033


So seems like those methods can help me. I also looked into log_input which logs every key being pressed. Does sublime saves those keys in some type of log file that I can have access to get those keys.

Let me explain what I am trying to do. I am trying to build a plugin where multiple users can work collaboratively on one file. (kind of like how google docs works). So if one user is typing I need to update the other user's content as well. That's why i need to get the keys and their locations.

Thanks
shercoder
 
Posts: 2
Joined: Mon Jan 14, 2013 2:34 am

Re: Keystroke detection

Postby FichteFoll on Sat Jan 19, 2013 3:54 am

I don't know of a way to hook into every keypress made in sublime (that is either not a key binding or just any key combination) and I personally doubt it's possible. It would be really interesting if it was because that could ease the handling of many `on_modified` events.
FichteFoll
 
Posts: 384
Joined: Fri Mar 16, 2012 11:49 pm
Location: Germany


Return to Plugin Development

Who is online

Users browsing this forum: Google [Bot] and 4 guests