Sublime Forum

Keystroke detection

#1

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

0 Likes

#2

Look into on_modified or on_query_context: Propagating captured keypress from key bindings

0 Likes

#3

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

0 Likes

#4

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.

0 Likes