inputexec
inputexec copied to clipboard
Hold buttons, double-clicks
Hi!
First of all, thank you for this nice piece of software! It works great!
Since I have only a few buttons on my remote, I would like to use a hold function were I hold a key for, let's say a second, and a different command is given. Same with doubleclicks. Do you think this is possible?
Best, vrs01
Hello !
Handling key hold could be doable: there is a KEYHOLD
evdev event; you could see if it works by running inputexec [your-usual-options] --filter=keyhold,keypress --action-mode=print
and seeing what happens.
Regarding double-click, it's a bit more complicated: right now, the reader "blocks" on the incoming events — the code will be totally asleep between two keypresses. In order to detect a double-click, we'd need to:
- On first keypress, start a timer
- If a second keypress occurs, drop the timer and execute the double-click command
- If the timer hasn't been dropped, run the single-click command
However, there might be some double-click support within evdev; according to https://www.kernel.org/doc/Documentation/input/event-codes.txt: "Some hardware send events when a key is repeated. These events have a value of 2."
Could you run those few tests with your device and tell me what you found?
Thanks :)
Hi! I found the keyhold and keyrelease functions in the example.ini. Very nice!