add ChangePointerKeyboardPairing request
authorPeter Hutterer <peter@cs.unisa.edu.au>
Mon, 29 Jan 2007 07:48:56 +0000 (18:18 +1030)
committerPeter Hutterer <whot@hyena.localdomain>
Mon, 29 Jan 2007 07:48:56 +0000 (18:18 +1030)
add pairingChangedNotify event

XI.h
XInput.h
XIproto.h

diff --git a/XI.h b/XI.h
index 3335c7d..52f8c4d 100644 (file)
--- a/XI.h
+++ b/XI.h
@@ -114,6 +114,7 @@ SOFTWARE.
 #define sz_xQueryDevicePointerReply             32
 #define sz_xWarpDevicePointerReq                28
 #define sz_xChangeDeviceCursorReq               16
+#define sz_xChangePointerKeyboardPairingReq      8
 
 #define INAME                  "XInputExtension"
 
@@ -256,10 +257,12 @@ SOFTWARE.
 #define _noExtensionEvent       9
 
 #define _devicePresence                 0
+#define _pairingChanged          1
 
 #define _deviceEnter             0
 #define _deviceLeave             1
 
+
 #define XI_BadDevice   0
 #define XI_BadEvent    1
 #define XI_BadMode     2
index 16c5a45..90a3ca3 100644 (file)
--- a/XInput.h
+++ b/XInput.h
@@ -159,6 +159,13 @@ SOFTWARE.
         _class =  (0x10000 | _devicePresence);                  \
     }
 
+#define PointerKeyboardPairing(dpy, type, _class)                       \
+    {                                                                   \
+    extern int _XiGetPointerKeyboardPairingNotifyEvent(Display *);      \
+    type = _XiGetPointerKeyboardPairingNotifyEvent(Display *);          \
+    _class = (0x10000 | _pairingNotify);                                \
+    }
+
 #define DeviceEnterNotify(d, type, _class) \
     FindTypeAndClass(d, type, _class, OtherClass, _deviceEnterNotify);
 
@@ -482,6 +489,23 @@ typedef struct {
 typedef XDeviceCrossingEvent XDeviceLeaveWindowEvent;
 typedef XDeviceCrossingEvent XDeviceEnterWindowEvent;
 
+/*
+ * Notifies the client that a mouse/keyboard mapping has changed. A mouse may
+ * have several keyboards mapped to it, but a keyboard can only map to one
+ * mouse.
+ * Keyboard events will follow the focus of the given mouse.
+ */
+typedef struct {
+    int           type;
+    unsigned long serial;       /* # of last request processed by server */
+    Bool          send_event;   /* true if this came from a SendEvent request */
+    Display       *display;     /* Display the event was read from */
+    Window        window;       /* unused */
+    Time          time;
+    XID           pointerid;    /* pointer deviceid */
+    XID           keyboardid;   /* keyboard deviceid */
+} XPointerKeyboardPairingChangedNotifyEvent;
+
 /*******************************************************************
  *
  * Control structures for input devices that support input class
@@ -1256,6 +1280,12 @@ extern Status   XUndefineDeviceCursor(
     Window              /* win */
 );
 
+extern Status   XChangePointerKeyboardPairing(
+    Display*            /* display */,
+    XDevice*            /* pointer */,
+    XDevice*            /* keyboard*/
+);
+
 
 _XFUNCPROTOEND
 
index 89f171a..1e941c1 100644 (file)
--- a/XIproto.h
+++ b/XIproto.h
@@ -72,7 +72,7 @@ SOFTWARE.
 
 #define numInputClasses 7
 
-#define IEVENTS                18
+#define IEVENTS                19
 #define IERRORS                5
 
 #define CLIENT_REQ             1
@@ -116,6 +116,7 @@ struct tmask
 #define XI_DevicePresenceNotify                15
 #define XI_DeviceEnterNotify            16
 #define XI_DeviceLeaveNotify            17
+#define XI_PointerKeyboardPairingChangedNotify 18
 
 /*********************************************************
  *
@@ -161,6 +162,7 @@ struct tmask
 #define X_QueryDevicePointer            36
 #define X_WarpDevicePointer             37
 #define X_ChangeDeviceCursor            38
+#define X_ChangePointerKeyboardPairing  39
 
 /*********************************************************
  *
@@ -1493,6 +1495,20 @@ typedef struct {
     CARD16      pad1;
 } xChangeDeviceCursorReq;
 
+/**********************************************************
+ *
+ * ChangePointerKeyboardPairing.
+ *
+ */
+
+typedef struct {
+    CARD8       reqType;        /* input extension major code */
+    CARD8       ReqType;        /* always X_ChangePointerKeyboardPairing */
+    CARD16      length B16;
+    CARD8       pointer;        /* ID of pointer devices */
+    CARD8       keyboard;       /* ID of keyboard device */               
+    CARD16      pad0;
+} xChangePointerKeyboardPairingReq;
 
 /**********************************************************
  *
@@ -1719,6 +1735,29 @@ typedef struct
 
 typedef deviceEnterNotify deviceLeaveNotify;
 
+/**********************************************************
+ *
+ * pairingChangedNotify.
+ *
+ */
+
+typedef struct
+    {
+    BYTE       type;
+    BYTE        pad00;
+    CARD16     sequenceNumber B16;
+    Time        time B32;
+    CARD8       pointer;
+    CARD8       keyboard;
+    CARD16      pad0;
+    CARD32      pad1;
+    CARD32      pad2;
+    CARD32      pad3;
+    CARD32      pad4;
+    CARD32      pad5;
+    CARD32      pad6;
+    }  pairingChangedNotify;
+
 
 #undef Window
 #undef Time