Permalink
Browse files

Emit an 'unknown' key event for any unknown key sequence.

This allows extensibility of the 'keypress' events in user-space, for example
parsing the output from "mouse reporting", which could then be re-emitted on
the Stream as 'mousedown' and 'mouseup' events.
  • Loading branch information...
1 parent 14b7c43 commit 3e839e8dcc228a46ab4505502b2cead1b3d7637b @TooTallNate committed Jan 27, 2012
Showing with 1 addition and 0 deletions.
  1. +1 −0 lib/tty.js
View
@@ -305,6 +305,7 @@ ReadStream.prototype._emitKey = function(s) {
/* misc. */
case '[Z': key.name = 'tab'; key.shift = true; break;
+ default: key.name = 'unknown'; key.sequence = s; break;
}
} else if (s.length > 1 && s[0] !== '\x1b') {

0 comments on commit 3e839e8

Please sign in to comment.