summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stone <krh@redhat.com>2006-07-18 11:45:07 -0400
committerDaniel Stone <daniels@endtroducing.fooishbar.org>2006-07-18 11:45:07 -0400
commitb22d8d0e1519d3f86474f4a79f3c4b27b46c662a (patch)
treebcfac0feed3fa82b1529b607cbd4462d1f0447b5
parent878d9e76764d27f5af861817b46b2caf2d89d7c4 (diff)
downloadxorg-lib-libXi-b22d8d0e1519d3f86474f4a79f3c4b27b46c662a.tar.gz
add DevicePresenceNotify event
Add a DevicePresenceNotify event, which notes that something about the device list changed.
-rw-r--r--src/XExtInt.c28
1 files changed, 27 insertions, 1 deletions
diff --git a/src/XExtInt.c b/src/XExtInt.c
index 811c0c3..e5baccb 100644
--- a/src/XExtInt.c
+++ b/src/XExtInt.c
@@ -122,7 +122,9 @@ XEXT_GENERATE_FIND_DISPLAY(XInput_find_display, xinput_info,
{XI_Present, XI_Add_XSetDeviceValuators_Major,
XI_Add_XSetDeviceValuators_Minor},
{XI_Present, XI_Add_XChangeDeviceControl_Major,
- XI_Add_XChangeDeviceControl_Minor}
+ XI_Add_XChangeDeviceControl_Minor},
+ {XI_Present, XI_Add_DevicePresenceNotify_Major,
+ XI_Add_DevicePresenceNotify_Minor}
};
/***********************************************************************
@@ -251,6 +253,14 @@ Ones(mask)
return (((y + (y >> 3)) & 030707070707) % 077);
}
+static int
+_XiGetDevicePresenceNotifyEvent(Display * dpy)
+{
+ XExtDisplayInfo *info = XInput_find_display(dpy);
+
+ return info->codes->first_event + XI_DevicePresenceNotify;
+}
+
/***********************************************************************
*
* Handle Input extension events.
@@ -665,6 +675,22 @@ XInputWireToEvent(dpy, re, event)
return (ENQUEUE_EVENT);
}
break;
+
+ case XI_DevicePresenceNotify:
+ {
+ XDevicePresenceNotifyEvent *ev = (XDevicePresenceNotifyEvent *) re;
+ devicePresenceNotify *ev2 = (devicePresenceNotify *) event;
+
+ fprintf(stderr, "got DevicePresenceNotify event (reltype=%d)\n",
+ reltype);
+
+ *ev = *(XDevicePresenceNotifyEvent *) save;
+ ev->window = 0;
+ ev->time = ev2->time;
+ return (ENQUEUE_EVENT);
+ }
+ break;
+
default:
printf("XInputWireToEvent: UNKNOWN WIRE EVENT! type=%d\n", type);
break;