diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2023-03-29 10:56:41 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2023-03-29 16:37:24 +1000 |
commit | 01a02d40333b7d558e9e757bda9ea97018d14c73 (patch) | |
tree | 0f2b5516d8175626d662b22c42466cc4304807b6 /src/evdev-fallback.c | |
parent | 41b16e6e4fe05734f40b676088af3c9301eb65a6 (diff) | |
download | libinput-01a02d40333b7d558e9e757bda9ea97018d14c73.tar.gz |
fallback: don't double-map if any left-handed buttons are down
The key_count array for buttons records the logical button sent to the
client - for left-handed configurations that means a BTN_LEFT is
recorded as BTN_RIGHT.
When the device is suspended and we are releasing all keys we must thus
release the button code as-is without trying to map it again.
Fixes #881
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'src/evdev-fallback.c')
-rw-r--r-- | src/evdev-fallback.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/evdev-fallback.c b/src/evdev-fallback.c index ae33d45a..129b214e 100644 --- a/src/evdev-fallback.c +++ b/src/evdev-fallback.c @@ -1057,10 +1057,15 @@ release_pressed_keys(struct fallback_dispatch *dispatch, LIBINPUT_KEY_STATE_RELEASED); break; case KEY_TYPE_BUTTON: + /* Note: the left-handed configuration is nonzero for + * the mapped button (not the physical button), in + * get_key_down_count(). We must not map this to left-handed + * again, see #881. + */ evdev_pointer_notify_button( device, time, - evdev_to_left_handed(device, code), + code, LIBINPUT_BUTTON_STATE_RELEASED); break; } |