2 .\" Copyright 1999 Oracle and/or its affiliates. All rights reserved.
4 .\" Permission is hereby granted, free of charge, to any person obtaining a
5 .\" copy of this software and associated documentation files (the "Software"),
6 .\" to deal in the Software without restriction, including without limitation
7 .\" the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 .\" and/or sell copies of the Software, and to permit persons to whom the
9 .\" Software is furnished to do so, subject to the following conditions:
11 .\" The above copyright notice and this permission notice (including the next
12 .\" paragraph) shall be included in all copies or substantial portions of the
15 .\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 .\" IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 .\" FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
18 .\" THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 .\" LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20 .\" FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
21 .\" DEALINGS IN THE SOFTWARE.
23 .TH XkbSetMap __libmansuffix__ __xorgversion__ "XKB FUNCTIONS"
25 XkbSetMap \- Send a complete new set of values for entire components to the
30 .BI "(\^Display *" "dpy" "\^,"
31 .BI "unsigned int " "which" "\^,"
32 .BI "XkbDescPtr " "xkb" "\^);"
38 connection to X server
41 mask selecting subcomponents to update
44 description from which new values are taken
47 There are two ways to make changes to map components: either change a local copy
48 of the keyboard map and
51 to send the modified map to the server, or, to reduce network traffic, use an
52 XkbMapChangesRec structure
58 to send a complete new set of values for entire components (for example, all
59 symbols, all actions, and so
60 on) to the server. The
62 parameter specifies the components to be sent to the server, and is a bitwise
63 inclusive OR of the masks
64 listed in Table 1. The
66 parameter is a pointer to an XkbDescRec structure and contains the information
67 to be copied to the server.
68 For each bit set in the
72 takes the corresponding structure values from the
74 parameter and sends it to the server specified by
77 If any components specified by
79 are not present in the
83 returns False. Otherwise, it sends the update request to the server and returns
86 can generate BadAlloc, BadLength, and BadValue protocol errors.
88 Key types, symbol maps, and actions are all interrelated; changes in one require
89 changes in the others. Xkb
90 provides functions to make it easier to edit these components and handle the
91 interdependencies. Table 1
92 lists these helper functions and provides a pointer to where they are defined.
99 lw(2i) l l lw(1i) lw(3i).
100 Table 1 Xkb Mapping Component Masks
101 and Convenience Functions
103 Mask Value Map Fields Convenience
142 T} (1<<2) client modmap T{
146 XkbExplicitComponentsMask
150 XkbGetKeyExplicitComponents
192 field identifies the map components that have changed in an XkbDescRec structure
193 and may contain any of the
194 bits in Table 1, which are also shown in Table 2. Every 1 bit in
196 also identifies which other fields in the XkbMapChangesRec structure contain
197 valid values, as indicated in
202 fields are for reference only; they are ignored on any requests sent to the
203 server and are always updated
204 by the server whenever it returns the data for an XkbMapChangesRec.
212 Table 2 XkbMapChangesRec Masks
215 Mask XkbMapChangesRec XkbDescRec Field Containing
218 XkbKeyTypesMask first_type, map->type[first_type] ..
219 num_types map->type[first_type + num_types - 1]
221 XkbKeySymsMask first_key_sym, map->key_sym_map[first_key_sym] ..
222 num_key_syms map->key_sym_map[first_key_sym +
224 XkbModifierMapMask first_modmap_key, map->modmap[first_modmap_key] ..
225 num_modmap_keys map->modmap[first_modmap_key +
227 XkbExplicitComponentsMask first_key_explicit,
228 server->explicit[first_key_explicit] ..
229 num_key_explicit server->explicit[first_key_explicit +
230 num_key_explicit - 1]
231 XkbKeyActionsMask first_key_act, server->key_acts[first_key_act] ..
232 num_key_acts server->key_acts[first_key_act +
234 XkbKeyBehaviorsMask first_key_behavior,
235 server->behaviors[first_key_behavior] ..
236 num_key_behaviors server->behaviors[first_key_behavior +
237 num_key_behaviors - 1]
238 XkbVirtualModsMask vmods server->vmods[*]
239 XkbVirtualModMapMask first_vmodmap_key,
240 server->vmodmap[first_vmodmap_key]
242 server->vmodmap[first_vmodmap_key
243 + num_vmodmap_keys - 1]
250 function returns True all components specified by
259 function returns False if any component specified by
261 is not present in the
267 Use the XkbMapChangesRec structure to identify and track partial modifications
268 to the mapping components
269 and to reduce the amount of traffic between the server and clients.
272 typedef struct _XkbMapChanges {
273 unsigned short changed; /\(** identifies valid components in structure */
274 KeyCode min_key_code; /\(** lowest numbered keycode for device */
275 KeyCode max_key_code; /\(** highest numbered keycode for device */
276 unsigned char first_type; /\(** index of first key type modified */
277 unsigned char num_types; /\(** # types modified */
278 KeyCode first_key_sym; /\(** first key whose key_sym_map changed */
279 unsigned char num_key_syms; /\(** # key_sym_map entries changed */
280 KeyCode first_key_act; /\(** first key whose key_acts entry changed */
281 unsigned char num_key_acts; /\(** # key_acts entries changed */
282 KeyCode first_key_behavior; /\(** first key whose behaviors changed */
283 unsigned char num_key_behaviors; /\(** # behaviors entries changed */
284 KeyCode first_key_explicit; /\(** first key whose explicit entry changed */
285 unsigned char num_key_explicit; /\(** # explicit entries changed */
286 KeyCode first_modmap_key; /\(** first key whose modmap entry changed */
287 unsigned char num_modmap_keys; /\(** # modmap entries changed */
288 KeyCode first_vmodmap_key; /\(** first key whose vmodmap changed */
289 unsigned char num_vmodmap_keys; /\(** # vmodmap entries changed */
290 unsigned char pad1; /\(** reserved */
291 unsigned short vmods; /\(** mask indicating which vmods changed */
292 } XkbMapChangesRec,*XkbMapChangesPtr;
296 The complete description of an Xkb keyboard is given by an XkbDescRec. The
298 structures in the XkbDescRec represent the major Xkb components.
302 struct _XDisplay * display; /\(** connection to X server */
303 unsigned short flags; /\(** private to Xkb, do not modify */
304 unsigned short device_spec; /\(** device of interest */
305 KeyCode min_key_code; /\(** minimum keycode for device */
306 KeyCode max_key_code; /\(** maximum keycode for device */
307 XkbControlsPtr ctrls; /\(** controls */
308 XkbServerMapPtr server; /\(** server keymap */
309 XkbClientMapPtr map; /\(** client keymap */
310 XkbIndicatorPtr indicators; /\(** indicator map */
311 XkbNamesPtr names; /\(** names for all components */
312 XkbCompatMapPtr compat; /\(** compatibility map */
313 XkbGeometryPtr geom; /\(** physical geometry of keyboard */
314 } XkbDescRec, *XkbDescPtr;
319 field points to an X display structure. The
320 .I flags field is private to the library: modifying
322 may yield unpredictable results. The
324 field specifies the device identifier of the keyboard input device, or
325 XkbUseCoreKeyboard, which specifies the core keyboard device. The
329 fields specify the least and greatest keycode that can be returned by the
332 Each structure component has a corresponding mask bit that is used in function
334 indicate that the structure should be manipulated in some manner, such as
336 or freeing it. These masks and their relationships to the fields in the
344 Table 3 Mask Bits for XkbDescRec
346 Mask Bit XkbDescRec Field Value
348 XkbControlsMask ctrls (1L<<0)
349 XkbServerMapMask server (1L<<1)
350 XkbIClientMapMask map (1L<<2)
351 XkbIndicatorMapMask indicators (1L<<3)
352 XkbNamesMask names (1L<<4)
353 XkbCompatMapMask compat (1L<<5)
354 XkbGeometryMask geom (1L<<6)
355 XkbAllComponentsMask All Fields (0x7f)
360 Unable to allocate storage
363 The length of a request is shorter or longer than that required to minimally
364 contain the arguments
367 An argument is out of range
369 .BR XkbChangeMap (__libmansuffix__),
370 .BR XkbChangeTypesOfKey (__libmansuffix__),
371 .BR XkbCopyKeyType (__libmansuffix__),
372 .BR XkbCopyKeyTypes (__libmansuffix__),
373 .BR XkbGetKeyActions (__libmansuffix__),
374 .BR XkbGetKeyBehaviors (__libmansuffix__),
375 .BR XkbGetKeyExplicitComponents (__libmansuffix__),
376 .BR XkbGetKeyModifierMap (__libmansuffix__),
377 .BR XkbGetKeySyms (__libmansuffix__),
378 .BR XkbGetKeyTypes (__libmansuffix__),
379 .BR XkbResizeKeyActions (__libmansuffix__),
380 .BR XkbResizeKeySyms (__libmansuffix__),
381 .BR XkbResizeKeyType (__libmansuffix__),
382 .BR XkbGetVirtualModMap (__libmansuffix__),
383 .BR XkbGetVirtualMods (__libmansuffix__)