In my embedded linux system, I defined some GPIOs as keys in the device tree so I can use them as keys in my application. This works fine so far.
Now I want to add an early startup script to respond to one of those keys before my application starts, but I can't access the gpios via /sys/class/gpio
anymore, because they are already keys (trying to export
them gives write error: Device or resource busy
).
I could install evtest
or simply read /dev/input/event0
where I can see key presses and releases, but I can't see a straight forward way to detect a long key press that way in a shell script. Any suggestion how this should be done?