| 1 |
'\" t |
| 2 |
.\" Title: xquerydevicestate |
| 3 |
.\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] |
| 4 |
.\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/> |
| 5 |
.\" Date: 09/05/2024 |
| 6 |
.\" Manual: \ \& |
| 7 |
.\" Source: \ \& |
| 8 |
.\" Language: English |
| 9 |
.\" |
| 10 |
.TH "XQUERYDEVICESTATE" "libmansuffix" "09/05/2024" "\ \&" "\ \&" |
| 11 |
.\" ----------------------------------------------------------------- |
| 12 |
.\" * Define some portability stuff |
| 13 |
.\" ----------------------------------------------------------------- |
| 14 |
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 15 |
.\" http://bugs.debian.org/507673 |
| 16 |
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html |
| 17 |
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 18 |
.ie \n(.g .ds Aq \(aq |
| 19 |
.el .ds Aq ' |
| 20 |
.\" ----------------------------------------------------------------- |
| 21 |
.\" * set default formatting |
| 22 |
.\" ----------------------------------------------------------------- |
| 23 |
.\" disable hyphenation |
| 24 |
.nh |
| 25 |
.\" disable justification (adjust text to left margin only) |
| 26 |
.ad l |
| 27 |
.\" ----------------------------------------------------------------- |
| 28 |
.\" * MAIN CONTENT STARTS HERE * |
| 29 |
.\" ----------------------------------------------------------------- |
| 30 |
.SH "NAME" |
| 31 |
XQueryDeviceState \- query the state of an extension input device\&. |
| 32 |
.SH "SYNOPSIS" |
| 33 |
.sp |
| 34 |
.nf |
| 35 |
#include <X11/extensions/XInput\&.h> |
| 36 |
.fi |
| 37 |
.sp |
| 38 |
.nf |
| 39 |
XDeviceState* XQueryDeviceState( Display *display, |
| 40 |
XDevice *device); |
| 41 |
.fi |
| 42 |
.sp |
| 43 |
.nf |
| 44 |
display |
| 45 |
Specifies the connection to the X server\&. |
| 46 |
.fi |
| 47 |
.sp |
| 48 |
.nf |
| 49 |
device |
| 50 |
Specifies the device whose state is to be queried\&. |
| 51 |
.fi |
| 52 |
.SH "DESCRIPTION" |
| 53 |
.sp |
| 54 |
.if n \{\ |
| 55 |
.RS 4 |
| 56 |
.\} |
| 57 |
.nf |
| 58 |
The XQueryDeviceState request queries the state of an input |
| 59 |
device\&. The current state of keys and buttons (up or down), and |
| 60 |
valuators (current value) on the device is reported by this |
| 61 |
request\&. Each key or button is represented by a bit in the |
| 62 |
XDeviceState structure that is returned\&. Valuators on the |
| 63 |
device report 0 if they are reporting relative information, and |
| 64 |
the current value if they are reporting absolute information\&. |
| 65 |
.fi |
| 66 |
.if n \{\ |
| 67 |
.RE |
| 68 |
.\} |
| 69 |
.sp |
| 70 |
.if n \{\ |
| 71 |
.RS 4 |
| 72 |
.\} |
| 73 |
.nf |
| 74 |
XQueryDeviceState can generate a BadDevice error\&. |
| 75 |
.fi |
| 76 |
.if n \{\ |
| 77 |
.RE |
| 78 |
.\} |
| 79 |
.sp |
| 80 |
.if n \{\ |
| 81 |
.RS 4 |
| 82 |
.\} |
| 83 |
.nf |
| 84 |
Structures: |
| 85 |
.fi |
| 86 |
.if n \{\ |
| 87 |
.RE |
| 88 |
.\} |
| 89 |
.sp |
| 90 |
.if n \{\ |
| 91 |
.RS 4 |
| 92 |
.\} |
| 93 |
.nf |
| 94 |
The XDeviceState structure contains: |
| 95 |
.fi |
| 96 |
.if n \{\ |
| 97 |
.RE |
| 98 |
.\} |
| 99 |
.sp |
| 100 |
.if n \{\ |
| 101 |
.RS 4 |
| 102 |
.\} |
| 103 |
.nf |
| 104 |
typedef struct { |
| 105 |
XID device_id; |
| 106 |
int num_classes; |
| 107 |
XInputClass *data; |
| 108 |
} XDeviceState; |
| 109 |
.fi |
| 110 |
.if n \{\ |
| 111 |
.RE |
| 112 |
.\} |
| 113 |
.sp |
| 114 |
.if n \{\ |
| 115 |
.RS 4 |
| 116 |
.\} |
| 117 |
.nf |
| 118 |
The XValuatorState structure contains: |
| 119 |
.fi |
| 120 |
.if n \{\ |
| 121 |
.RE |
| 122 |
.\} |
| 123 |
.sp |
| 124 |
.if n \{\ |
| 125 |
.RS 4 |
| 126 |
.\} |
| 127 |
.nf |
| 128 |
typedef struct { |
| 129 |
unsigned char class; |
| 130 |
unsigned char length; |
| 131 |
unsigned char num_valuators; |
| 132 |
unsigned char mode; |
| 133 |
int *valuators; |
| 134 |
} XValuatorState; |
| 135 |
.fi |
| 136 |
.if n \{\ |
| 137 |
.RE |
| 138 |
.\} |
| 139 |
.sp |
| 140 |
.if n \{\ |
| 141 |
.RS 4 |
| 142 |
.\} |
| 143 |
.nf |
| 144 |
The XKeyState structure contains: |
| 145 |
.fi |
| 146 |
.if n \{\ |
| 147 |
.RE |
| 148 |
.\} |
| 149 |
.sp |
| 150 |
.if n \{\ |
| 151 |
.RS 4 |
| 152 |
.\} |
| 153 |
.nf |
| 154 |
typedef struct { |
| 155 |
unsigned char class; |
| 156 |
unsigned char length; |
| 157 |
short num_keys; |
| 158 |
char keys[32]; |
| 159 |
} XKeyState; |
| 160 |
.fi |
| 161 |
.if n \{\ |
| 162 |
.RE |
| 163 |
.\} |
| 164 |
.sp |
| 165 |
.if n \{\ |
| 166 |
.RS 4 |
| 167 |
.\} |
| 168 |
.nf |
| 169 |
The XButtonState structure contains: |
| 170 |
.fi |
| 171 |
.if n \{\ |
| 172 |
.RE |
| 173 |
.\} |
| 174 |
.sp |
| 175 |
.if n \{\ |
| 176 |
.RS 4 |
| 177 |
.\} |
| 178 |
.nf |
| 179 |
typedef struct { |
| 180 |
unsigned char class; |
| 181 |
unsigned char length; |
| 182 |
short num_buttons; |
| 183 |
char buttons[32]; |
| 184 |
} XButtonState; |
| 185 |
.fi |
| 186 |
.if n \{\ |
| 187 |
.RE |
| 188 |
.\} |
| 189 |
.SH "DIAGNOSTICS" |
| 190 |
.sp |
| 191 |
.if n \{\ |
| 192 |
.RS 4 |
| 193 |
.\} |
| 194 |
.nf |
| 195 |
BadDevice |
| 196 |
An invalid device was specified\&. The specified device |
| 197 |
does not exist or has not been opened by this client via |
| 198 |
XOpenInputDevice\&. This error may also occur if some |
| 199 |
other client has caused the specified device to become |
| 200 |
the X keyboard or X pointer device via the |
| 201 |
XChangeKeyboardDevice or XChangePointerDevice requests\&. |
| 202 |
.fi |
| 203 |
.if n \{\ |
| 204 |
.RE |
| 205 |
.\} |