1XQueryDeviceState(3)              X FUNCTIONS             XQueryDeviceState(3)
2
3
4

NAME

6       XQueryDeviceState - query the state of an extension input device.
7

SYNTAX

9       int XQueryDeviceState(Display *display, XDevice *device);
10

ARGUMENTS

12       display     Specifies the connection to the X server.
13
14       device      Specifies the device whose state is to be queried.
15

DESCRIPTION

17       The  XQueryDeviceState  request  queries  the state of an input device.
18       The current state of keys and buttons (up or down), and valuators (cur‐
19       rent  value)  on  the  device is reported by this request.  Each key or
20       button is represented by a bit in the XDeviceState  structure  that  is
21       returned.  Valuators on the device report 0 if they are reporting rela‐
22       tive information, and the current value if they are reporting  absolute
23       information.
24
25       XQueryDeviceState can generate a BadDevice error.
26

STRUCTURES

28       The XDeviceState structure contains:
29
30       typedef struct {
31            XID device_id;
32            int num_classes;
33            XInputClass *data;
34       } XDeviceState;
35
36       The XValuatorState structure contains:
37
38       typedef struct {
39            unsigned char class;
40            unsigned char length;
41            unsigned char num_valuators;
42            unsigned char mode;
43            int *valuators;
44       } XValuatorState;
45
46       The XKeyState structure contains:
47
48       typedef struct {
49            unsigned char class;
50            unsigned char length;
51            short         num_keys;
52            char keys[32];
53       } XKeyState;
54
55       The XButtonState structure contains:
56
57       typedef struct {
58            unsigned char class;
59            unsigned char length;
60            short         num_buttons;
61            char buttons[32];
62       } XButtonState;
63

DIAGNOSTICS

65       BadDevice   An invalid device was specified.  The specified device does
66                   not exist or has not been opened by this client via  XOpen‐
67                   InputDevice.   This  error  may  also  occur  if some other
68                   client has caused the specified device to become the X key‐
69                   board  or X pointer device via the XChangeKeyboardDevice or
70                   XChangePointerDevice requests.
71

SEE ALSO

73       Programming with Xlib
74
75
76
77X Version 11                      libXi 1.1.1             XQueryDeviceState(3)
Impressum