tomzx / gkm

⚠ Unsupported/Unmaintained ⚠️️ Global Keyboard and Mouse listener for node.js.
MIT License
52 stars 16 forks source link

Is there a way to get the keyboard cursor location? #7

Closed humanely closed 6 years ago

humanely commented 7 years ago

Hi,

I want to get the coordinate of cursor location of keyboard. It is different than mouse pointer location. Is there a way to extend gkm to achieve that?

Rgds

tomzx commented 7 years ago

If you're talking about the "blinking" cursor (or simply the cursor that displays where you are typing), then my first answer would be that it's not currently possible.

You obviously have many ways to add this, namely extend gkm directly to use something else than gkm-java which relies on JNativeHook, which afaik, does not offer any information regarding keyboard cursor position. You could also extend gkm-java to do so. It would require implementing the necessary logic in Java. gkm simply spawns a process that sends it through stdout 1 event per line. If you follow the same current output formatting rules that are currently used to output keyboard and mice events, it shouldn't be too difficult to add new events.