1XQUERYDEVICESTATE(3)                                      XQUERYDEVICESTATE(3)
2
3
4

NAME

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

SYNOPSIS

9       #include <X11/extensions/XInput.h>
10
11       XDeviceState* XQueryDeviceState( Display *display,
12                                        XDevice *device);
13
14       display
15              Specifies the connection to the X server.
16
17       device
18              Specifies the device whose state is to be queried.
19

DESCRIPTION

21           The XQueryDeviceState request queries the state of an input
22           device. The current state of keys and buttons (up or down), and
23           valuators (current value) on the device is reported by this
24           request. Each key or button is represented by a bit in the
25           XDeviceState structure that is returned. Valuators on the
26           device report 0 if they are reporting relative information, and
27           the current value if they are reporting absolute information.
28
29           XQueryDeviceState can generate a BadDevice error.
30
31           Structures:
32
33           The XDeviceState structure contains:
34
35           typedef struct {
36               XID device_id;
37               int num_classes;
38               XInputClass *data;
39           } XDeviceState;
40
41           The XValuatorState structure contains:
42
43           typedef struct {
44               unsigned char class;
45               unsigned char length;
46               unsigned char num_valuators;
47               unsigned char mode;
48               int *valuators;
49           } XValuatorState;
50
51           The XKeyState structure contains:
52
53           typedef struct {
54               unsigned char class;
55               unsigned char length;
56               short     num_keys;
57               char keys[32];
58           } XKeyState;
59
60           The XButtonState structure contains:
61
62           typedef struct {
63               unsigned char class;
64               unsigned char length;
65               short     num_buttons;
66               char buttons[32];
67           } XButtonState;
68

DIAGNOSTICS

70           BadDevice
71                  An invalid device was specified. The specified device
72                  does not exist or has not been opened by this client via
73                  XOpenInputDevice. This error may also occur if some
74                  other client has caused the specified device to become
75                  the X keyboard or X pointer device via the
76                  XChangeKeyboardDevice or XChangePointerDevice requests.
77
78
79
80                                  09/15/2021              XQUERYDEVICESTATE(3)
Impressum