1XkbKeyHasActions(3) XKB FUNCTIONS XkbKeyHasActions(3)
2
3
4
6 XkbKeyHasActions - Determines if the key corresponding to keycode has
7 any actions associated with it
8
10 int XkbKeyHasActions (XkbDescPtr xkb, KeyCode keycode);
11
13 - xkb Xkb description of interest
14
15 - keycode
16 keycode of interest
17
19 A key action defines the effect key presses and releases have on the
20 internal state of the server. For example, the expected key action
21 associated with pressing the Shift key is to set the Shift modifier.
22 There is zero or one key action associated with each keysym bound to
23 each key.
24
25 Just as the entire list of key symbols for the keyboard mapping is held
26 in the syms field of the client map, the entire list of key actions for
27 the keyboard mapping is held in the acts array of the server map. The
28 total size of acts is specified by size_acts, and the number of entries
29 is specified by num_acts.
30
31 The key_acts array, indexed by keycode, describes the actions associ‐
32 ated with a key. The key_acts array has min_key_code unused entries at
33 the start to allow direct indexing using a keycode. If a key_acts entry
34 is zero, it means the key does not have any actions associated with it.
35 If an entry is not zero, the entry represents an index into the acts
36 field of the server map, much as the offset field of a KeySymMapRec
37 structure is an index into the syms field of the client map.
38
39 The reason the acts field is a linear list of XkbActions is to reduce
40 the memory consumption associated with a keymap. Because Xkb allows
41 individual keys to have multiple shift levels and a different number of
42 groups per key, a single two-dimensional array of KeySyms would poten‐
43 tially be very large and sparse. Instead, Xkb provides a small two-
44 dimensional array of XkbActions for each key. To store all of these
45 individual arrays, Xkb concatenates each array together in the acts
46 field of the server map.
47
48 The key action structures consist only of fields of type char or
49 unsigned char. This is done to optimize data transfer when the server
50 sends bytes over the wire. If the fields are anything but bytes, the
51 server has to sift through all of the actions and swap any nonbyte
52 fields. Because they consist of nothing but bytes, it can just copy
53 them out.
54
55 XkbKeyHasActions returns True if the key corresponding to keycode has
56 any actions associated with it; otherwise, it returns False.
57
59 True The XkbKeyHasActions function will return True if the
60 key corresponding to keycode has any actions associated
61 with it.
62
63 False The XkbKeyHasActions function will return False if the
64 key corresponding to keycode does not have any actions
65 associated with it.
66
68 The KeySymMapRec structure is defined as follows:
69
70 #define XkbNumKbdGroups 4
71 #define XkbMaxKbdGroup (XkbNumKbdGroups-1)
72
73 typedef struct { /∗ map to keysyms for a single keycode */
74 unsigned char kt_index[XkbNumKbdGroups]; /∗ key type index for each group */
75 unsigned char group_info; /∗ # of groups and out of range group handling */
76 unsigned char width; /∗ max # of shift levels for key */
77 unsigned short offset; /∗ index to keysym table in syms array */
78 } XkbSymMapRec, *XkbSymMapPtr;
79
80
81
82
83X Version 11 libX11 1.6.9 XkbKeyHasActions(3)