[mutter/wip/multitouch: 3/8] input-events: Handle touch events
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter/wip/multitouch: 3/8] input-events: Handle touch events
- Date: Sat, 6 Aug 2011 09:16:13 +0000 (UTC)
commit b50ef079b6513329b4b04d0dbef781c2518b6eab
Author: Carlos Garnacho <carlosg gnome org>
Date: Tue Aug 2 19:06:06 2011 +0200
input-events: Handle touch events
TouchBegin/End/Update are now handled similarly to
ButtonPress/Release/MotionNotify.
src/core/input-events.c | 41 +++++++++++++++++++++++++++++++++++++++++
1 files changed, 41 insertions(+), 0 deletions(-)
---
diff --git a/src/core/input-events.c b/src/core/input-events.c
index c24c78a..b8ac5da 100644
--- a/src/core/input-events.c
+++ b/src/core/input-events.c
@@ -86,6 +86,17 @@ meta_input_event_get_type (MetaDisplay *display,
case XI_Leave:
type = LeaveNotify;
break;
+#ifdef HAVE_XTOUCH
+ case XI_TouchBegin:
+ type = ButtonPress;
+ break;
+ case XI_TouchEnd:
+ type = ButtonRelease;
+ break;
+ case XI_TouchUpdate:
+ type = MotionNotify;
+ break;
+#endif /* HAVE_XTOUCH */
default:
retval = FALSE;
break;
@@ -159,6 +170,11 @@ meta_input_event_get_window (MetaDisplay *display,
case XI_ButtonRelease:
case XI_KeyPress:
case XI_KeyRelease:
+#ifdef HAVE_XTOUCH
+ case XI_TouchBegin:
+ case XI_TouchEnd:
+ case XI_TouchUpdate:
+#endif /* HAVE_XTOUCH */
return ((XIDeviceEvent *) xev)->event;
case XI_FocusIn:
case XI_FocusOut:
@@ -195,6 +211,11 @@ meta_input_event_get_root_window (MetaDisplay *display,
case XI_ButtonRelease:
case XI_KeyPress:
case XI_KeyRelease:
+#ifdef HAVE_XTOUCH
+ case XI_TouchBegin:
+ case XI_TouchEnd:
+ case XI_TouchUpdate:
+#endif /* HAVE_XTOUCH */
return ((XIDeviceEvent *) xev)->root;
case XI_FocusIn:
case XI_FocusOut:
@@ -250,6 +271,11 @@ meta_input_event_get_time (MetaDisplay *display,
case XI_ButtonRelease:
case XI_KeyPress:
case XI_KeyRelease:
+#ifdef HAVE_XTOUCH
+ case XI_TouchBegin:
+ case XI_TouchEnd:
+ case XI_TouchUpdate:
+#endif /* HAVE_XTOUCH */
return ((XIDeviceEvent *) xev)->time;
case XI_FocusIn:
case XI_FocusOut:
@@ -312,6 +338,11 @@ meta_input_event_get_coordinates (MetaDisplay *display,
case XI_ButtonRelease:
case XI_KeyPress:
case XI_KeyRelease:
+#ifdef HAVE_XTOUCH
+ case XI_TouchBegin:
+ case XI_TouchEnd:
+ case XI_TouchUpdate:
+#endif /* HAVE_XTOUCH */
{
XIDeviceEvent *event = (XIDeviceEvent *) xev;
@@ -422,6 +453,11 @@ meta_input_event_get_state (MetaDisplay *display,
case XI_ButtonRelease:
case XI_KeyPress:
case XI_KeyRelease:
+#ifdef HAVE_XTOUCH
+ case XI_TouchBegin:
+ case XI_TouchEnd:
+ case XI_TouchUpdate:
+#endif /* HAVE_XTOUCH */
s = ((XIDeviceEvent *) xev)->mods.effective;
break;
case XI_FocusIn:
@@ -643,6 +679,11 @@ meta_input_event_get_device (MetaDisplay *display,
case XI_ButtonRelease:
case XI_KeyPress:
case XI_KeyRelease:
+#ifdef HAVE_XTOUCH
+ case XI_TouchBegin:
+ case XI_TouchEnd:
+ case XI_TouchUpdate:
+#endif /* HAVE_XTOUCH */
return meta_device_map_lookup (display->device_map,
((XIDeviceEvent *) xev)->deviceid);
case XI_FocusIn:
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]