libinput doesn't handle EV_KEY event with a value of 255 (BUTTON_CANCLED), to support Android home buttons
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Mir |
Triaged
|
Medium
|
Unassigned | ||
libinput (Ubuntu) |
Confirmed
|
Undecided
|
Unassigned | ||
mir (Ubuntu) |
Triaged
|
Medium
|
Unassigned |
Bug Description
I port Ubuntu Touch to LG L90 Dual. When I press a button below the screen (it's the touch button and is part of the touch screen), then slide the finger up, a letter will repeatedly appear in any text field selected (for instance, if the button is a menu button, letter 'e' will appear repeatedly). Using evtest with the touch screen device, I can see what happened:
Event: time 75.605520, type 1 (EV_KEY), code 139 (KEY_MENU), value 1
Event: time 75.605525, -------------- EV_SYN ------------
Event: time 75.707065, type 1 (EV_KEY), code 139 (KEY_MENU), value 255
(See the full log here: http://
When I place the finger down, touch screen will send an event with type 1 (EV_KEY), code 139 (KEY_MENU), and value 1, indicating that the button is placed. And when I move the finger away from the button, touch screen will send an event with type 1 (EV_KEY), code 139 (KEY_MENU), and value 255. Digging in kernel code reveals that this is defined as "BUTTON_CANCLED". Looking in libevent code, it seems that it always assume that anything that is not 0 will be considered as pressed, which makes it looks like the button is hold.
tags: | added: input |
summary: |
libinput doesn't handle EV_KEY event with a value of 255 - (BUTTON_CANCLED) + (BUTTON_CANCLED), to support virtual Android home buttons |
So the touchscreen tries to mimic a UI button that only sends a release when the finger is released while inside the button area.
Since mir does not receive a release event from libinput we send repeat events instead.
Should we define a cancel key press event type? That might be useful in other situations too. E.g. when handling pressed keys during VT switching.