Merge branch 'master' of ssh://tz.otcshare.org/profile/base/libXi
[platform/upstream/libXi.git] / man / XQueryDeviceState.txt
1 XQUERYDEVICESTATE(libmansuffix)
2 ===============================
3
4 NAME
5 ----
6
7    XQueryDeviceState - query the state of an extension input
8    device.
9
10 SYNOPSIS
11 --------
12
13    #include <X11/extensions/XInput.h>
14
15    XDeviceState* XQueryDeviceState( Display *display,
16                                     XDevice *device);
17    
18    display
19           Specifies the connection to the X server.
20
21    device
22           Specifies the device whose state is to be queried.
23
24 DESCRIPTION
25 -----------
26
27    The XQueryDeviceState request queries the state of an input
28    device. The current state of keys and buttons (up or down), and
29    valuators (current value) on the device is reported by this
30    request. Each key or button is represented by a bit in the
31    XDeviceState structure that is returned. Valuators on the
32    device report 0 if they are reporting relative information, and
33    the current value if they are reporting absolute information.
34
35    XQueryDeviceState can generate a BadDevice error.
36
37    Structures:
38
39    The XDeviceState structure contains:
40
41                 typedef struct {
42                     XID device_id;
43                     int num_classes;
44                     XInputClass *data;
45                 } XDeviceState;
46
47    The XValuatorState structure contains:
48
49                 typedef struct {
50                     unsigned char class;
51                     unsigned char length;
52                     unsigned char num_valuators;
53                     unsigned char mode;
54                     int *valuators;
55                 } XValuatorState;
56
57    The XKeyState structure contains:
58
59                 typedef struct {
60                     unsigned char class;
61                     unsigned char length;
62                     short     num_keys;
63                     char keys[32];
64                 } XKeyState;
65
66    The XButtonState structure contains:
67
68                 typedef struct {
69                     unsigned char class;
70                     unsigned char length;
71                     short     num_buttons;
72                     char buttons[32];
73                 } XButtonState;
74
75 DIAGNOSTICS
76 -----------
77
78    BadDevice
79           An invalid device was specified. The specified device
80           does not exist or has not been opened by this client via
81           XOpenInputDevice. This error may also occur if some
82           other client has caused the specified device to become
83           the X keyboard or X pointer device via the
84           XChangeKeyboardDevice or XChangePointerDevice requests.