keyupdown
v0.0.2
Published
node-keyupdown ==============
Downloads
1
Readme
node-keyupdown
emulate keyup and keydown on nodejs.
Sample
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()