5

I've been working with a keyboard to remap certain keys and create macros etc.

I understand the keyboard (via USB, I'm talking about a desktop computer with a USB keyboard) provides a scancode which dependant on the keyboard, is mapped to key descriptors or keycodes based on the rules made up from various hwdb resources. Those keycodes are then interpreted by the operating system.

I find that evtest gives the best results directly from the keyboard since it contains the keyboards scancodes, keycodes and key symbols all in one neat little output. To make it cleaner I usually grep the output to be even tidier:

sudo evtest | grep -B1 "value 1"

However, the codes as used by xmodmap and various applications are those as output (and if output) y xev. I don't have a nice grep for xev, I just filter by keyboard events:

xev -event keyboard

This question deals with

I'm sure someone will suggest it is because the first 8 codes are reserved, but that should be irrelevant, shouldn't it? The keycode, reserved or not, should it not be output as a raw code than a value which is transposed (whether by arbitrary or fixed value) and can lead to errors?

I really am just trying to understand the difference as to why some programs output and why some system require input that are out by 8 and how to ratify that inconsistency in my mind.

Madivad
  • 371
  • I forgot to mention/add, often evtest will output keycode info even when xev will not. On numerous occasions, xev reports a line of 0,0,0,0,0 instead of anything useful, where as evtest reports keycodes, they're just out by 8 compared to what xev would have produced, if it produced anything – Madivad Aug 30 '19 at 14:19

0 Answers0