Ignore BTN_TOOL_* events when posting button events
authorPeter Hutterer <peter.hutterer@who-t.net>
Thu, 26 Nov 2015 01:51:20 +0000 (11:51 +1000)
committerPeter Hutterer <peter.hutterer@who-t.net>
Wed, 2 Dec 2015 21:08:34 +0000 (07:08 +1000)
These aren't real button events and they are handled elsewhere, either through
proper touch events on touchscreen or through custom handling in the touchpad
case.

https://bugs.freedesktop.org/show_bug.cgi?id=93165

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
src/evdev.c

index ec3abc6c403d3e5267aa1fc101a2fd5f00284c11..4933185e9cdb28ec23139b4b795aa7d211fe66bc 100644 (file)
@@ -439,8 +439,22 @@ evdev_flush_pending_event(struct evdev_device *device, uint64_t time)
 static enum evdev_key_type
 get_key_type(uint16_t code)
 {
-       if (code == BTN_TOUCH)
+       switch (code) {
+       case BTN_TOOL_PEN:
+       case BTN_TOOL_RUBBER:
+       case BTN_TOOL_BRUSH:
+       case BTN_TOOL_PENCIL:
+       case BTN_TOOL_AIRBRUSH:
+       case BTN_TOOL_MOUSE:
+       case BTN_TOOL_LENS:
+       case BTN_TOOL_QUINTTAP:
+       case BTN_TOOL_DOUBLETAP:
+       case BTN_TOOL_TRIPLETAP:
+       case BTN_TOOL_QUADTAP:
+       case BTN_TOOL_FINGER:
+       case BTN_TOUCH:
                return EVDEV_KEY_TYPE_NONE;
+       }
 
        if (code >= KEY_ESC && code <= KEY_MICMUTE)
                return EVDEV_KEY_TYPE_KEY;