I've been playing around with capturing the input from my keyboard device:
/dev/input/by-path/platform-i8042-serio-0-event-kbd
for me, and I was wondering if there was any specification for what it returns, using
od -tx1 /dev/input/by-path/platform-i8042-serio-0-event-kbd
to listen. I'm curious mostly due to the behavior of certain keys; the meta, arrow keys, numpad forward slash.
0520300 ac 9d 86 4c 6b 0f 04 00 04 00 04 00 (db) 00 00 00
0520320 ac 9d 86 4c 8c 0f 04 00 01 00 (7d) 00 00 00 00 00
0520340 ac 9d 86 4c 95 0f 04 00 00 00 00 00 00 00 00 00
Every other key I've looked at so far has the two bytes in parentheses as matching values, is there any reason these are special?
/dev/input/by-path/platform-i8042-serio-0-event-kbdis just a symlink to/dev/input/eventXevent device file. Data can be read from event device files asdefined in
/usr/include/linux/input.h.Possible values of
typeare prefixed withEV_. Possible values ofcodedepend ontype. They are prefixed withKEY_orBTN_orREL_or so on. Possible values ofvaluedepend on bothtypeandcode. For example for key-press eventsvalueequals1and for key-release events0.You can examine event data with:
where
Xis the event device number of your keyboard (or any other event device). One key press or release normally emits three events (EV_MSC,EV_KEYandEV_SYN).