1 .\" Copyright 1999 Oracle and/or its affiliates. All rights reserved.
3 .\" Permission is hereby granted, free of charge, to any person obtaining a
4 .\" copy of this software and associated documentation files (the "Software"),
5 .\" to deal in the Software without restriction, including without limitation
6 .\" the rights to use, copy, modify, merge, publish, distribute, sublicense,
7 .\" and/or sell copies of the Software, and to permit persons to whom the
8 .\" Software is furnished to do so, subject to the following conditions:
10 .\" The above copyright notice and this permission notice (including the next
11 .\" paragraph) shall be included in all copies or substantial portions of the
14 .\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 .\" IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 .\" FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17 .\" THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 .\" LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 .\" FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 .\" DEALINGS IN THE SOFTWARE.
22 .TH XkbKeyActionEntry __libmansuffix__ __xorgversion__ "XKB FUNCTIONS"
24 XkbKeyActionEntry \- Returns a pointer to the key action corresponding to
25 group grp and shift level lvl from the two-dimensional table of key actions
26 associated with the key corresponding to
30 .B XkbAction * XkbKeyActionEntry
31 .BI "(\^XkbDescPtr " "xkb" "\^,"
32 .BI "KeyCode " "keycode" "\^,"
33 .BI "int " "shift" "\^,"
34 .BI "int " "grp" "\^);"
40 Xkb description of interest
46 shift level within group
49 group index for group of interest
52 A key action defines the effect key presses and releases have on the internal
53 state of the server. For example,
54 the expected key action associated with pressing the Shift key is to set the
55 Shift modifier. There is zero or one
56 key action associated with each keysym bound to each key.
58 Just as the entire list of key symbols for the keyboard mapping is held in the
60 field of the client map, the entire list of key actions for the keyboard mapping
63 array of the server map. The total size of
67 and the number of entries is specified by
72 array, indexed by keycode, describes the actions associated with a key. The
76 unused entries at the start to allow direct indexing using a keycode. If a
78 entry is zero, it means the key does not have any actions associated with it. If
79 an entry is not zero, the entry
80 represents an index into the
82 field of the server map, much as the
84 field of a KeySymMapRec structure is an index into the
86 field of the client map.
90 field is a linear list of XkbActions is to reduce the memory consumption
91 associated with a keymap. Because Xkb
92 allows individual keys to have multiple shift levels and a different number of
93 groups per key, a single
94 two-dimensional array of KeySyms would potentially be very large and sparse.
95 Instead, Xkb provides a small
96 two-dimensional array of XkbActions for each key. To store all of these
97 individual arrays, Xkb concatenates each
100 field of the server map.
102 The key action structures consist only of fields of type char or unsigned char.
103 This is done to optimize data
104 transfer when the server sends bytes over the wire. If the fields are anything
105 but bytes, the server has to sift
106 through all of the actions and swap any nonbyte fields. Because they consist of
107 nothing but bytes, it can just
111 returns the key action corresponding to group
115 from the two-dimensional table of key actions associated with the key
120 The KeySymMapRec structure is defined as follows:
123 #define XkbNumKbdGroups 4
124 #define XkbMaxKbdGroup (XkbNumKbdGroups-1)
126 typedef struct { /\(** map to keysyms for a single keycode
128 unsigned char kt_index[XkbNumKbdGroups]; /\(** key type index for
130 unsigned char group_info; /\(** # of groups and out of range group
132 unsigned char width; /\(** max # of shift levels for key */
133 unsigned short offset; /\(** index to keysym table in syms array
135 } XkbSymMapRec, *XkbSymMapPtr;