https://github.com/hash-bang/node-x11-keyboard
Simple X11 keyboard input module
https://github.com/hash-bang/node-x11-keyboard
Last synced: about 2 months ago
JSON representation
Simple X11 keyboard input module
- Host: GitHub
- URL: https://github.com/hash-bang/node-x11-keyboard
- Owner: hash-bang
- Created: 2014-04-29T05:24:56.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2014-04-29T05:27:53.000Z (about 11 years ago)
- Last Synced: 2025-03-15T06:04:32.129Z (2 months ago)
- Language: JavaScript
- Size: 105 KB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
X11-Keyboard
============
Simple X11 keyboard input module.There doesn't appear to be any way of getting decent keybaord input within Node that specifies things like the keyRelease event.
This module creates a dummy X11 window and attaches a keyboard listener to it so you can extract detailed keyboard information.
It inherits the generic Node [EventEmitter](http://nodejs.org/api/events.html#events_class_events_eventemitter) class so you can use all the normal callback functions like `on()`, `off()`, `once()` etc.
Examples
--------var keyboard = new require('./app.js');
keyboard.on('key.down:a', function() {
console.log('A key pressed');
});keyboard.on('key.up:a', function() {
console.log('A key released');
});keyboard.on('key.up:ctrl+b', function() {
console.log('Ctrl+B pressed');
});