keyboard-listener
Listens for keypress on all connected keyboards. The device name is passed to handle different behaviours based upon the keyboard.
const keyboardListener = require('./listener.js')
new keyboardListener().onKeypress((keyId, deviceName) => {
console.log("keyboardListener", keyId, deviceName);
})
Troubleshooting
Error EACCES: permission denied. code: 'EACCES'
: Most likely you will need to add your user to the input
group.