libinput: Support for long press key detection?

Peter Hutterer peter.hutterer at who-t.net
Wed Oct 22 02:40:39 PDT 2014


On Tue, Oct 21, 2014 at 08:21:26PM +0200, Stefanie Behme wrote:
> Hi,
> 
> on last ELCE in Duesseldorf I learned that the development of libinput was
> started to handle input devices in Wayland compositors. I had a look in the
> API documentation and found that the enum "libinput_key_state" has these
> values: LIBINPUT_KEY_STATE_RELEASED and LIBINPUT_KEY_STATE_PRESSED.
> 
> There is a need to detect if a key is pressed (and hold) for a certain
> amount of time. If this is the case a long-press key event is send. It is
> also possible that several long-press key events are defined for one key,
> e.g.:
> - 500 ms: KEY_STATE_LONG_PRESSED_1
> - 1000 ms: KEY_STATE_LONG_PRESSED_2
> - 5000 ms: KEY_STATE_LONG_PRESSED_3
> 
> A long press on a key is e.g. used to create a screen shot.
> 
> Is there any plan to support this kind of long press detection? How could
> this look like? Any ideas?

this would be too high-level for libinput. If you need that functionality,
best is to handle it with a timer in the compositor where you also have more
semantic information than in libinput.

Cheers,
   Peter



More information about the wayland-devel mailing list