Reputation: 1601
Can you get system wide keypress events and/or mouse movement events in nodejs? Thanks!
Upvotes: 5
Views: 6026
Reputation: 43
You can use node-java at least for mouse control. See this https://stackoverflow.com/a/21080830/578181
Upvotes: 0
Reputation: 1601
I ended up writing a system specific application to do this that send the reply back over a local socket connection and using node's ability to exec processes and detect the OS to determine which version to launch. I think the comment to this being very system specific is the issue here.
Hopefully either node or the node-webkit folks through Chromium's ability to this will include it in node-webkit. Hope this helps someone in the future and thanks to everyone who tried to help!
Upvotes: 2
Reputation: 25466
This very platform specific. If you are using X Window you can grab keyboard/mouse using node-x11 client
Upvotes: 1
Reputation: 40163
That would not be NodeJS as that is server side. Use plain Javascript such as the Keypress lib or some jQuery. If you want your server to react based on this you'll need to make an Ajax call or use something like SocketIO (real time interaction between server/client)
Edit: I just saw that you tagged it node-webkit. I'm a little unclear if you need the kepress to reach server. Either way the above libs should do the trick.
Upvotes: -2