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