doc: readline.emitKeypressEvents and raw mode

`readline.emitKeypressEvents` needs `stream` to be in raw mode.

PR-URL: https://github.com/nodejs/node/pull/6628
Fixes: https://github.com/nodejs/node/issues/6626
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Roman Klauke <romaaan.git@gmail.com>
This commit is contained in:
Arve Seljebu authored and Evan Lucas committed 2016-05-17 08:39:25 -05:00
1 parent 1c7b6e276f
commit 2273971a69
1 file changed
+9
+9
View File
@@ -362,6 +362,15 @@ Move cursor to the specified position in a given TTY stream.
Causes `stream` to begin emitting `'keypress'` events corresponding to its
input.
Note that the stream, if it is a TTY, needs to be in raw mode:
```js
readline.emitKeypressEvents(process.stdin);
if (process.stdin.isTTY) {
// might not be a TTY if spawned from another node process
process.stdin.setRawMode(true);
}
```
## readline.moveCursor(stream, dx, dy)
Move cursor relative to it's current position in a given TTY stream.