evdev
evdev copied to clipboard
(Doc Suggestion) Switch BTN_DPAD_UP to KEY_UP in Virtual Keyboard example
It's quite possible I'm the only person who would run into a problem with this, so feel free to ignore if that's the case.
It took me a little while debugging to realize that BTN_DPAD_UP and KEY_UP were not the same key; I had gotten the mouse example working and was playing around with the virtual keyboard example but couldn't figure out why nothing seemed to be happening or registering even though evtest
showed the events coming through. My thought was "there must be a Linux event I need to throw to get the system to start paying attention to this device." When I started fiddling around more with the example, changing keys didn't seem to help much because I kept sticking to the BTN_
prefix when I swapped keys around.
Looking at evtest
output for the normal keyboard and realizing that the event names didn't line up is what eventually clued me to the reason, and when I switched over to KEY_UP
, KEY_(whatever)
everything was working perfectly. But that only happened after I read through a bunch of Arch documentation trying to figure out if I needed to set a device property or something.
Again, it may just be me, feel free to ignore if you think this is more common knowledge, but if someone is coming in without the understanding that directional pad events can come through a keyboard device, and if their system isn't set up to respond to the directional pad events already, they might repeat my mistake and run the virtual keyboard code example and assume nothing is happening? If that's the case it might be clearer to use a KEY_
input instead of a BTN_DPAD
input (but again, maybe that's something that's fairly standard knowledge).