inputexec icon indicating copy to clipboard operation
inputexec copied to clipboard

Hold buttons, double-clicks

Open vrs01 opened this issue 7 years ago • 2 comments

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

vrs01 avatar Jun 02 '17 08:06 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:

  1. On first keypress, start a timer
  2. If a second keypress occurs, drop the timer and execute the double-click command
  3. 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 :)

rbarrois avatar Jun 14 '17 21:06 rbarrois

Hi! I found the keyhold and keyrelease functions in the example.ini. Very nice!

vrs01 avatar Jun 15 '17 20:06 vrs01