[PATCH 3/3] evdev: treat BTN_TOUCH as BTN_LEFT

Tiago Vignatti tiago.vignatti at intel.com
Thu Sep 1 09:00:05 PDT 2011


idea stolen from xorg evdev.

Signed-off-by: Tiago Vignatti <tiago.vignatti at intel.com>
---
 compositor/evdev.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/compositor/evdev.c b/compositor/evdev.c
index 662a61c..113eded 100644
--- a/compositor/evdev.c
+++ b/compositor/evdev.c
@@ -48,7 +48,6 @@ evdev_process_key(struct evdev_input_device *device,
                         struct input_event *e, int value, int time)
 {
 	switch (e->code) {
-	case BTN_TOUCH:
 	case BTN_TOOL_PEN:
 	case BTN_TOOL_RUBBER:
 	case BTN_TOOL_BRUSH:
@@ -65,6 +64,11 @@ evdev_process_key(struct evdev_input_device *device,
 		}
 		break;
 
+	case BTN_TOUCH:
+		/* Treat BTN_TOUCH from devices that only have BTN_TOUCH as
+		 * BTN_LEFT */
+		e->code = BTN_LEFT;
+		/* Intentional fallthrough! */
 	case BTN_LEFT:
 	case BTN_RIGHT:
 	case BTN_MIDDLE:
-- 
1.7.2.2



More information about the wayland-devel mailing list