1XOPENDEVICE(3)                                                  XOPENDEVICE(3)
2
3
4

NAME

6       XOpenDevice, XCloseDevice - open or close an extension input device
7

SYNOPSIS

9       #include <X11/extensions/XInput.h>
10
11       XDevice *XOpenDevice( Display *display,
12                             XID device_id);
13
14       XCloseDevice( Display *display,
15                     XDevice *device);
16
17       display
18              Specifies the connection to the X server.
19
20       device_id
21              Specifies the id of the device to be opened
22
23       device
24              Specifies the device to be closed
25

DESCRIPTION

27           The XOpenDevice request makes an input device accessible to a
28           client through input extension protocol requests. If
29           successful, it returns a pointer to an XDevice structure.
30
31           The XCloseDevice request makes an input device inaccessible to
32           a client through input extension protocol requests. Before
33           terminating, and client that has opened input devices through
34           the input extension should close them via CloseDevice.
35
36           When a client makes an XCloseDevice request, any active grabs
37           that the client has on the device are released. Any event
38           selections that the client has are deleted, as well as any
39           passive grabs. If the requesting client is the last client
40           accessing the device, the server may disable all access by X to
41           the device.
42
43           XOpenDevice and XCloseDevice can generate a BadDevice error.
44
45       Structures
46
47           The XDevice structure returned by XOpenDevice contains:
48                        typedef struct {
49                        XID device_id;
50                        int num_classes;
51                        XInputClassInfo *classes;
52                        } XDevice;
53
54           The classes field is a pointer to an array of XInputClassInfo
55           structures. Each element of this array contains an event type
56           base for a class of input supported by the specified device.
57           The num_classes field indicates the number of elements in the
58           classes array.
59
60           The XInputClassInfo structure contains:
61
62           typedef struct {
63               unsigned char input_class;
64               unsigned char event_type_base;
65           } XInputClassInfo;
66
67           The input_class field identifies one class of input supported
68           by the device. Defined types include KeyClass, ButtonClass,
69           ValuatorClass, ProximityClass, FeedbackClass, FocusClass, and
70           OtherClass. The event_type_base identifies the event type of
71           the first event in that class.
72
73           The information contained in the XInputClassInfo structure is
74           used by macros to obtain the event classes that clients use in
75           making XSelectExtensionEvent requests. Currently defined macros
76           include DeviceKeyPress, DeviceKeyRelease, DeviceButtonPress,
77           DeviceButtonRelese, DeviceMotionNotify, DeviceFocusIn,
78           DeviceFocusOut, ProximityIn, ProximityOut, DeviceStateNotify,
79           DeviceMappingNotify, ChangeDeviceNotify,
80           DevicePointerMotionHint, DeviceButton1Motion,
81           DeviceButton2Motion, DeviceButton3Motion, DeviceButton4Motion,
82           DeviceButton5Motion, DeviceButtonMotion, DeviceOwnerGrabButton,
83           DeviceButtonPressGrab, and NoExtensionEvent.
84
85           To obtain the proper event class for a particular device, one
86           of the above macros is invoked using the XDevice structure for
87           that device. For example,
88                        DeviceKeyPress (*device, type, eventclass);
89
90           returns the DeviceKeyPress event type and the eventclass for
91           DeviceKeyPress events from the specified device.
92
93           This eventclass can then be used in an XSelectExtensionEvent
94           request to ask the server to send DeviceKeyPress events from
95           this device. When a selected event is received via XNextEvent,
96           the type can be used for comparison with the type in the event.
97

DIAGNOSTICS

99           BadDevice
100                  An invalid device was specified. The specified device
101                  does not exist, or is the X keyboard or X pointer. This
102                  error may also occur if some other client has caused the
103                  specified device to become the X keyboard or X pointer
104                  device via the XChangeKeyboardDevice or
105                  XChangePointerDevice requests.
106
107
108
109                                  03/09/2013                    XOPENDEVICE(3)
Impressum