https://github.com/terrierscript/node-keyupdown
[experimental] emulate keyup and keydown on nodejs
https://github.com/terrierscript/node-keyupdown
Last synced: 3 months ago
JSON representation
[experimental] emulate keyup and keydown on nodejs
- Host: GitHub
- URL: https://github.com/terrierscript/node-keyupdown
- Owner: terrierscript
- License: mit
- Created: 2013-09-05T09:50:20.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2014-11-19T06:23:07.000Z (about 11 years ago)
- Last Synced: 2024-04-15T12:17:42.365Z (almost 2 years ago)
- Language: JavaScript
- Homepage:
- Size: 142 KB
- Stars: 3
- Watchers: 2
- Forks: 4
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
node-keyupdown
==============
emulate keyup and keydown on nodejs.
## Sample
```javascript
var keydownup = require("./index")
keydownup(process.stdin)
process.stdin.on('keydown', function(){
console.log("keydown")
})
process.stdin.on('keyup', function(){
console.log("keyup")
})
process.stdin.on('keypress', function(ch, key){
console.log("keypress")
if(key && key.name == "c" && key.ctrl){
console.log("exit")
process.exit()
}
})
process.stdin.setRawMode(true);
process.stdin.resume()
```