File: XOpenDevice.man

package info (click to toggle)
libxi 2:1.3-8
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 2,476 kB
  • ctags: 906
  • sloc: sh: 10,500; ansic: 6,600; makefile: 454
file content (245 lines) | stat: -rw-r--r-- 5,330 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
'\" t
.\"     Title: xopendevice
.\"    Author: [FIXME: author] [see http://docbook.sf.net/el/author]
.\" Generator: DocBook XSL Stylesheets v1.74.3 <http://docbook.sf.net/>
.\"      Date: 10/02/2009
.\"    Manual: [FIXME: manual]
.\"    Source: [FIXME: source]
.\"  Language: English
.\"
.TH "XOPENDEVICE" "libmansuffix" "10/02/2009" "[FIXME: source]" "[FIXME: manual]"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
XOpenDevice, XCloseDevice \- open or close an extension input device
.SH "SYNOPSIS"
.sp
.nf
#include <X11/extensions/XInput\&.h>
.fi
.sp
.nf
XDevice *XOpenDevice( Display *display,
                      XID device_id);
.fi
.sp
.nf
XCloseDevice( Display *display,
              XDevice *device);
.fi
.sp
.nf
display
       Specifies the connection to the X server\&.
.fi
.sp
.nf
device_id
       Specifies the id of the device to be opened
.fi
.sp
.nf
device
       Specifies the device to be closed
.fi
.SH "DESCRIPTION"
.sp
.if n \{\
.RS 4
.\}
.nf
The XOpenDevice request makes an input device accessible to a
client through input extension protocol requests\&. If
successful, it returns a pointer to an XDevice structure\&.
.fi
.if n \{\
.RE
.\}
.sp
.if n \{\
.RS 4
.\}
.nf
The XCloseDevice request makes an input device inaccessible to
a client through input extension protocol requests\&. Before
terminating, and client that has opened input devices through
the input extension should close them via CloseDevice\&.
.fi
.if n \{\
.RE
.\}
.sp
.if n \{\
.RS 4
.\}
.nf
When a client makes an XCloseDevice request, any active grabs
that the client has on the device are released\&. Any event
selections that the client has are deleted, as well as any
passive grabs\&. If the requesting client is the last client
accessing the device, the server may disable all access by X to
the device\&.
.fi
.if n \{\
.RE
.\}
.sp
.if n \{\
.RS 4
.\}
.nf
XOpenDevice and XCloseDevice can generate a BadDevice error\&.
.fi
.if n \{\
.RE
.\}
.sp
Structures
.sp
.if n \{\
.RS 4
.\}
.nf
The XDevice structure returned by XOpenDevice contains:
             typedef struct {
             XID device_id;
             int num_classes;
             XInputClassInfo *classes;
             } XDevice;
.fi
.if n \{\
.RE
.\}
.sp
.if n \{\
.RS 4
.\}
.nf
The classes field is a pointer to an array of XInputClassInfo
structures\&. Each element of this array contains an event type
base for a class of input supported by the specified device\&.
The num_classes field indicates the number of elements in the
classes array\&.
.fi
.if n \{\
.RE
.\}
.sp
.if n \{\
.RS 4
.\}
.nf
The XInputClassInfo structure contains:
.fi
.if n \{\
.RE
.\}
.sp
.if n \{\
.RS 4
.\}
.nf
typedef struct {
    unsigned char input_class;
    unsigned char event_type_base;
} XInputClassInfo;
.fi
.if n \{\
.RE
.\}
.sp
.if n \{\
.RS 4
.\}
.nf
The input_class field identifies one class of input supported
by the device\&. Defined types include KeyClass, ButtonClass,
ValuatorClass, ProximityClass, FeedbackClass, FocusClass, and
OtherClass\&. The event_type_base identifies the event type of
the first event in that class\&.
.fi
.if n \{\
.RE
.\}
.sp
.if n \{\
.RS 4
.\}
.nf
The information contained in the XInputClassInfo structure is
used by macros to obtain the event classes that clients use in
making XSelectExtensionEvent requests\&. Currently defined macros
include DeviceKeyPress, DeviceKeyRelease, DeviceButtonPress,
DeviceButtonRelese, DeviceMotionNotify, DeviceFocusIn,
DeviceFocusOut, ProximityIn, ProximityOut, DeviceStateNotify,
DeviceMappingNotify, ChangeDeviceNotify,
DevicePointerMotionHint, DeviceButton1Motion,
DeviceButton2Motion, DeviceButton3Motion, DeviceButton4Motion,
DeviceButton5Motion, DeviceButtonMotion, DeviceOwnerGrabButton,
DeviceButtonPressGrab, and NoExtensionEvent\&.
.fi
.if n \{\
.RE
.\}
.sp
.if n \{\
.RS 4
.\}
.nf
To obtain the proper event class for a particular device, one
of the above macros is invoked using the XDevice structure for
that device\&. For example,
             DeviceKeyPress (*device, type, eventclass);
.fi
.if n \{\
.RE
.\}
.sp
.if n \{\
.RS 4
.\}
.nf
returns the DeviceKeyPress event type and the eventclass for
DeviceKeyPress events from the specified device\&.
.fi
.if n \{\
.RE
.\}
.sp
.if n \{\
.RS 4
.\}
.nf
This eventclass can then be used in an XSelectExtensionEvent
request to ask the server to send DeviceKeyPress events from
this device\&. When a selected event is received via XNextEvent,
the type can be used for comparison with the type in the event\&.
.fi
.if n \{\
.RE
.\}
.SH "DIAGNOSTICS"
.sp
.if n \{\
.RS 4
.\}
.nf
BadDevice
       An invalid device was specified\&. The specified device
       does not exist, or is the X keyboard or X pointer\&. This
       error may also occur if some other client has caused the
       specified device to become the X keyboard or X pointer
       device via the XChangeKeyboardDevice or
       XChangePointerDevice requests\&.
.fi
.if n \{\
.RE
.\}