if(state[0]===2){ keyStream.removeAllListeners(['data']);
let on = true; keyStream.on('data', state => { console.log(state); // array of ascii codes if(state[0]===2 && on){ on = false;