From: José Expósito Date: Mon, 14 Nov 2022 17:38:13 +0000 (+0100) Subject: touchpad: add escape and asterisk to the DWT blacklist X-Git-Tag: 1.22.0~4 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0da2d0095cfe3635b5bf8943defe315c4f58d322;p=platform%2Fupstream%2Flibinput.git touchpad: add escape and asterisk to the DWT blacklist The escape key can be used to cancel a drag and drop action in some desktop environments. However, it triggers disable-while-typing, ending the drag and drop action rather than cancelling it. Add it to the tp_key_ignore_for_dwt() set to avoid it. Since I'm here, add the asterisk key as it is the only numpad key not ignored by tp_key_ignore_for_dwt(). Fix: https://gitlab.freedesktop.org/libinput/libinput/-/issues/820 # [1] Suggested-by: satrmb <10471-satrmb@users.noreply.gitlab.freedesktop.org> Signed-off-by: José Expósito --- diff --git a/src/evdev-mt-touchpad.c b/src/evdev-mt-touchpad.c index ea9c8f1e..a6afbdac 100644 --- a/src/evdev-mt-touchpad.c +++ b/src/evdev-mt-touchpad.c @@ -2285,7 +2285,13 @@ tp_key_ignore_for_dwt(unsigned int keycode) if (tp_key_is_modifier(keycode)) return false; - return keycode >= KEY_F1; + switch (keycode) { + case KEY_ESC: + case KEY_KPASTERISK: + return true; + default: + return keycode >= KEY_F1; + } } static void diff --git a/test/test-touchpad.c b/test/test-touchpad.c index b55d979f..c0b596a9 100644 --- a/test/test-touchpad.c +++ b/test/test-touchpad.c @@ -4195,6 +4195,9 @@ START_TEST(touchpad_dwt_modifier_no_dwt) KEY_COMPOSE, KEY_RIGHTMETA, KEY_LEFTMETA, + KEY_ESC, + KEY_KPASTERISK, + KEY_F1, }; if (!has_disable_while_typing(touchpad))