1b4b4f611662370e6e16ecbfe14fe7301ae2e267
[platform/upstream/libXi.git] / man / XGetDeviceModifierMapping.man
1 '\" t
2 .\"     Title: xgetdevicemodifiermapping
3 .\"    Author: [FIXME: author] [see http://docbook.sf.net/el/author]
4 .\" Generator: DocBook XSL Stylesheets v1.76.1 <http://docbook.sf.net/>
5 .\"      Date: 09/23/2011
6 .\"    Manual: [FIXME: manual]
7 .\"    Source: [FIXME: source]
8 .\"  Language: English
9 .\"
10 .TH "XGETDEVICEMODIFIERMA" "libmansuffix" "09/23/2011" "[FIXME: source]" "[FIXME: manual]"
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 XGetDeviceModifierMapping, XSetDeviceModifierMapping \- query or change device modifier mappings
32 .SH "SYNOPSIS"
33 .sp
34 .nf
35 #include <X11/extensions/XInput\&.h>
36 .fi
37 .sp
38 .nf
39 int XSetDeviceModifierMapping( Display *display,
40                                XDevice *device,
41                                XModifierKeymap *modmap);
42 .fi
43 .sp
44 .nf
45 XModifierKeymap *XGetDeviceModifierMapping( Display *display,
46                                             XDevice *device);
47 .fi
48 .sp
49 .nf
50 display
51        Specifies the connection to the X server\&.
52 .fi
53 .sp
54 .nf
55 device
56        Specifies the device whose modifier mapping is to be
57        queried or modified\&.
58 .fi
59 .sp
60 .nf
61 modmap
62        Specifies a pointer to the XModifierKeymap structure\&.
63 .fi
64 .SH "DESCRIPTION"
65 .sp
66 .if n \{\
67 .RS 4
68 .\}
69 .nf
70 The XSetDeviceModifierMapping request specifies the KeyCodes of
71 the keys (if any) that are to be used as modifiers for the
72 specified device\&. If it succeeds, the X server generates a
73 DeviceMappingNotify event, and XSetDeviceModifierMapping
74 returns MappingSuccess\&. X permits at most eight modifier keys\&.
75 If more than eight are specified in the XModifierKeymap
76 structure, a BadLength error results\&.
77 .fi
78 .if n \{\
79 .RE
80 .\}
81 .sp
82 .if n \{\
83 .RS 4
84 .\}
85 .nf
86 The modifiermap member of the XModifierKeymap structure
87 contains eight sets of max_keypermod KeyCodes, one for each
88 modifier in the order Shift, Lock, Control, Mod1, Mod2, Mod3,
89 Mod4, and Mod5\&. Only nonzero KeyCodes have meaning in each set,
90 and zero KeyCodes are ignored\&. In addition, all of the nonzero
91 KeyCodes must be in the range specified by min_keycode and
92 max_keycode as returned by XListInputDevices, or a BadValue
93 error results\&. No KeyCode may appear twice in the entire map,
94 or a BadValue error results\&.
95 .fi
96 .if n \{\
97 .RE
98 .\}
99 .sp
100 .if n \{\
101 .RS 4
102 .\}
103 .nf
104 An X server can impose restrictions on how modifiers can be
105 changed, for example, if certain keys do not generate up
106 transitions in hardware, if auto\-repeat cannot be disabled on
107 certain keys, or if multiple modifier keys are not supported\&.
108 If some such restriction is violated, the status reply is
109 MappingFailed, and none of the modifiers are changed\&. If the
110 new KeyCodes specified for a modifier differ from those
111 currently defined and any (current or new) keys for that
112 modifier are in the logically down state,
113 XSetDeviceModifierMapping returns MappingBusy, and none of the
114 modifiers is changed\&.
115 .fi
116 .if n \{\
117 .RE
118 .\}
119 .sp
120 .if n \{\
121 .RS 4
122 .\}
123 .nf
124 XSetDeviceModifierMapping can generate BadLength, BadDevice,
125 BadMatch, BadAlloc, and BadValue errors\&.
126 .fi
127 .if n \{\
128 .RE
129 .\}
130 .sp
131 .if n \{\
132 .RS 4
133 .\}
134 .nf
135 The XGetDeviceModifierMapping request returns a pointer to a
136 newly created XModifierKeymap structure that contains the keys
137 being used as modifiers\&. The structure should be freed after
138 use by calling XFreeModifierMapping \&. If only zero values
139 appear in the set for any modifier, that modifier is disabled\&.
140 .fi
141 .if n \{\
142 .RE
143 .\}
144 .sp
145 .if n \{\
146 .RS 4
147 .\}
148 .nf
149 XGetDeviceModifierMapping can generate BadDevice and BadMatch
150 errors\&.
151 .fi
152 .if n \{\
153 .RE
154 .\}
155 .sp
156 Structures
157 .sp
158 .if n \{\
159 .RS 4
160 .\}
161 .nf
162 The XModifierKeymap structure contains:
163 .fi
164 .if n \{\
165 .RE
166 .\}
167 .sp
168 .if n \{\
169 .RS 4
170 .\}
171 .nf
172 typedef struct {
173 int max_keypermod;
174 KeyCode *modifiermap;
175 } XModifierKeymap;
176 .fi
177 .if n \{\
178 .RE
179 .\}
180 .SH "DIAGNOSTICS"
181 .sp
182 .if n \{\
183 .RS 4
184 .\}
185 .nf
186 BadLength
187        More than eight keys were specified in the
188        XModifierKeymap structure\&.
189 .fi
190 .if n \{\
191 .RE
192 .\}
193 .sp
194 .if n \{\
195 .RS 4
196 .\}
197 .nf
198 BadAlloc
199        The server failed to allocate the requested resource or
200        server memory\&.
201 .fi
202 .if n \{\
203 .RE
204 .\}
205 .sp
206 .if n \{\
207 .RS 4
208 .\}
209 .nf
210 BadDevice
211        An invalid device was specified\&. The specified device
212        does not exist or has not been opened by this client via
213        XOpenInputDevice\&. This error may also occur if the
214        specified device is the X keyboard or X pointer device\&.
215 .fi
216 .if n \{\
217 .RE
218 .\}
219 .sp
220 .if n \{\
221 .RS 4
222 .\}
223 .nf
224 BadMatch
225        This error may occur if an XGetDeviceModifierMapping or
226        XChangeDeviceModifierMapping request was made specifying
227        a device that has no keys\&.
228 .fi
229 .if n \{\
230 .RE
231 .\}
232 .sp
233 .if n \{\
234 .RS 4
235 .\}
236 .nf
237 BadValue
238        Some numeric value falls outside the range of values
239        accepted by the request\&. Unless a specific range is
240        specified for an argument, the full range defined by the
241        argument\*(Aqs type is accepted\&. Any argument defined as a
242        set of alternatives can generate this error\&.
243 .fi
244 .if n \{\
245 .RE
246 .\}
247 .SH "SEE ALSO"
248 .sp
249 .if n \{\
250 .RS 4
251 .\}
252 .nf
253 XSetDeviceKeyMapping(libmansuffix), XSetDeviceButtonMapping(libmansuffix)
254 .fi
255 .if n \{\
256 .RE
257 .\}