1XkbKeyNumActions(3) XKB FUNCTIONS XkbKeyNumActions(3)
2
3
4
6 XkbKeyNumActions - Computes the number of actions associated with the
7 key corresponding to keycode
8
10 int XkbKeyNumActions (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 as‐
21 sociated 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 in‐
41 dividual 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-di‐
44 mensional array of XkbActions for each key. To store all of these indi‐
45 vidual arrays, Xkb concatenates each array together in the acts field
46 of the server map.
47
48 The key action structures consist only of fields of type char or un‐
49 signed 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 XkbKeyNumActions computes the number of actions associated with the key
56 corresponding to keycode. This should be the same value as the result
57 of XkbKeyNumSyms.
58
60 The KeySymMapRec structure is defined as follows:
61
62 #define XkbNumKbdGroups 4
63 #define XkbMaxKbdGroup (XkbNumKbdGroups-1)
64
65 typedef struct { /* map to keysyms for a single keycode */
66 unsigned char kt_index[XkbNumKbdGroups]; /* key type index for each group */
67 unsigned char group_info; /* # of groups and out of range group handling */
68 unsigned char width; /* max # of shift levels for key */
69 unsigned short offset; /* index to keysym table in syms array */
70 } XkbSymMapRec, *XkbSymMapPtr;
71
72
74 XkbKeyNumSyms(3)
75
76
77
78X Version 11 libX11 1.8.7 XkbKeyNumActions(3)