diff options
author | cjihrig <cjihrig@gmail.com> | 2016-04-02 21:08:22 -0400 |
---|---|---|
committer | cjihrig <cjihrig@gmail.com> | 2016-04-05 10:48:59 -0400 |
commit | 0a62f929da0cff816d79d2ed2b9b3b4ecdd50586 (patch) | |
tree | e84850ab613c4038e37391470a757f625f71764d /lib/internal/readline.js | |
parent | 3de9bc94294d0cab691d8a6e261733e8a8e98342 (diff) | |
download | android-node-v8-0a62f929da0cff816d79d2ed2b9b3b4ecdd50586.tar.gz android-node-v8-0a62f929da0cff816d79d2ed2b9b3b4ecdd50586.tar.bz2 android-node-v8-0a62f929da0cff816d79d2ed2b9b3b4ecdd50586.zip |
readline: emit key info unconditionally
Currently, 'keypress' events include the sequence and key info
for named keys, but only the sequence for unnamed keys. This
commit causes the key info to be included in both cases.
PR-URL: https://github.com/nodejs/node/pull/6024
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com>
Diffstat (limited to 'lib/internal/readline.js')
-rw-r--r-- | lib/internal/readline.js | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/internal/readline.js b/lib/internal/readline.js index aad0794a68..3248c7c50a 100644 --- a/lib/internal/readline.js +++ b/lib/internal/readline.js @@ -384,9 +384,8 @@ function* emitKeys(stream) { stream.emit('keypress', escaped ? undefined : s, key); } else if (s.length === 1) { /* Single unnamed character, e.g. "." */ - stream.emit('keypress', s); - } else { - /* Unrecognized or broken escape sequence, don't emit anything */ + stream.emit('keypress', s, key); } + /* Unrecognized or broken escape sequence, don't emit anything */ } } |