获取用户输入的keymap,我用如下代码无法获取课程中的keymap?
keymap
{
sequence: '\x1B[B',
name: 'down',
ctrl: false,
meta: false,
shift: false,
}
const readline = require('readline')
const rl = readline.createInterface({
input: process.stdin,
output: process.stdout,
})
rl.input.on('keypress', function(key) {
console.log('key', key) // 输入向下键盘,打印undefined
})
11
收起
恭喜解决一个难题,获得1积分~
来为老师/同学的回答评分吧
0 星