Sample Header Ad - 728x90

/dev/input/event doesn't report keys being pressed

2 votes
0 answers
697 views
I have an usb keyboard connected to a linux box. I need to capture all keys that have been pressed and released. enter image description here My keyboard n-key rollover meaning that it doesn't have limits on number of concurrent keys being held. They are all detected and reported. They keyboard works fine in terminal and x-windows. I can press and hold keys one after another and each time a new character appears on the screen. I tried ten and they are all detected. HOWEVER: when I read data from /dev/input/eventX corresponding to keyboard the data stops coming after 6 keys has been pressed. I wrote a small program in node.js, but I can observe the same behaviour even by doing "cat /dev/input/eventX". It's very puzzling, because I would assume that there is a same driver that is used to read keycodes and display them in terminal. Anyone has any idea where and why event file is not receiving any data past 6 keys? What would be a way around this problem ? Tried with RPI (Debian and Ubuntu), OrangePI (Ubuntu) and PC (LinuxMint). Thanks, M here is the node.js code * const InputEvent = require('input-event'); const input = new InputEvent('/dev/input/event0'); function keyReleased(input) { console.log(input.code); } const keyboard = new InputEvent.Keyboard(input); keyboard.on('data' , function(input) { console.log("DATA:" + input.code); }); *
Asked by Misha Mikhail (21 rep)
Sep 16, 2022, 06:43 PM
Last activity: Sep 17, 2022, 08:10 PM