After installing keypress (npm install keypress
), running this in the Node REPL will show you what the names an codes are for different keypresses.
var keypress = require('keypress');
// make `process.stdin` begin emitting "keypress" events
keypress(process.stdin);
// listen for the "keypress" event
process.stdin.on('keypress', function (ch, key) {