1XkbGetVirtualMods(3) XKB FUNCTIONS XkbGetVirtualMods(3)
2
3
4
6 XkbGetVirtualMods - Obtain a subset of the virtual modifier bindings
7 (the vmods array) in a keyboard description
8
10 Status XkbGetVirtualMods (Display *dpy, unsigned int which, XkbDescPtr
11 xkb);
12
14 dpy connection to server
15
16 which mask indicating virtual modifier bindings to get
17
18 xkb Xkb description where results will be placed
19
21 XkbGetVirtualMods sends a request to the server to obtain the vmods en‐
22 tries for the virtual modifiers specified in the mask, which, and waits
23 for a reply.
24
25 Virtual modifiers are named by converting their string name to an X
26 Atom and storing the Atom in the names.vmods array in an XkbDescRec
27 structure. The position of a name Atom in the names.vmods array defines
28 the bit position used to represent the virtual modifier and also the
29 index used when accessing virtual modifier information in arrays: the
30 name in the i-th (0 relative) entry of names.vmods is the i-th virtual
31 modifier, represented by the mask (1<<i). Throughout Xkb, various func‐
32 tions have a parameter that is a mask representing virtual modifier
33 choices. In each case, the i-th bit (0 relative) of the mask represents
34 the i-th virtual modifier.
35
36 To set the name of a virtual modifier, use XkbSetNames, using XkbVir‐
37 tualModNamesMask in which and the name in the xkb argument; to retrieve
38 indicator names, use XkbGetNames.
39
40 For each bit set in which, XkbGetVirtualMods updates the corresponding
41 virtual modifier definition in the server->vmods array of xkb. The xkb
42 parameter must be a pointer to a valid Xkb keyboard description. If
43 successful, XkbGetVirtualMods returns Success.
44
45 Virtual Modifier Names and Masks
46
47 Virtual modifiers are named by converting their string name to an X
48 Atom and storing the Atom in the names.vmods array in an XkbDescRec
49 structure. The position of a name Atom in the names.vmods array defines
50 the bit position used to represent the virtual modifier and also the
51 index used when accessing virtual modifier information in arrays: the
52 name in the i-th (0 relative) entry of names.vmods is the i-th virtual
53 modifier, represented by the mask (1<<i). Throughout Xkb, various func‐
54 tions have a parameter that is a mask representing virtual modifier
55 choices. In each case, the i-th bit (0 relative) of the mask represents
56 the i-th virtual modifier.
57
58 To set the name of a virtual modifier, use XkbSetNames, using XkbVir‐
59 tualModNamesMask in which and the name in the xkb argument; to retrieve
60 indicator names, use XkbGetNames.
61
62 If the server map has not been allocated in the xkb parameter, Xk‐
63 bGetVirtualMods allocates and initializes it before obtaining the vir‐
64 tual modifier bindings.
65
66 If the server does not have a compatible version of Xkb, or the Xkb ex‐
67 tension has not been properly initialized, XkbGetVirtualMods returns
68 BadMatch. Any errors in allocation cause XkbGetVirtualMods to return
69 BadAlloc.
70
72 Success The XkbGetVirtualMods function returns Success when it
73 successfully updates the corresponding virtual modifier
74 definition in the server->vmods array of xkb.
75
77 The complete description of an Xkb keyboard is given by an XkbDescRec.
78 The component structures in the XkbDescRec represent the major Xkb com‐
79 ponents.
80
81 typedef struct {
82 struct _XDisplay * display; /* connection to X server */
83 unsigned short flags; /* private to Xkb, do not modify */
84 unsigned short device_spec; /* device of interest */
85 KeyCode min_key_code; /* minimum keycode for device */
86 KeyCode max_key_code; /* maximum keycode for device */
87 XkbControlsPtr ctrls; /* controls */
88 XkbServerMapPtr server; /* server keymap */
89 XkbClientMapPtr map; /* client keymap */
90 XkbIndicatorPtr indicators; /* indicator map */
91 XkbNamesPtr names; /* names for all components */
92 XkbCompatMapPtr compat; /* compatibility map */
93 XkbGeometryPtr geom; /* physical geometry of keyboard */
94 } XkbDescRec, *XkbDescPtr;
95
96 The display field points to an X display structure. The flags field is
97 private to the library: modifying flags may yield unpredictable re‐
98 sults. The device_spec field specifies the device identifier of the
99 keyboard input device, or XkbUseCoreKeyboard, which specifies the core
100 keyboard device. The min_key_code and max_key_code fields specify the
101 least and greatest keycode that can be returned by the keyboard.
102
103 Each structure component has a corresponding mask bit that is used in
104 function calls to indicate that the structure should be manipulated in
105 some manner, such as allocating it or freeing it. These masks and their
106 relationships to the fields in the XkbDescRec are shown in Table 1.
107
108
109 Table 1 Mask Bits for XkbDescRec
110 ──────────────────────────────────────────────────
111 Mask Bit XkbDescRec Field Value
112 ──────────────────────────────────────────────────
113 XkbControlsMask ctrls (1L<<0)
114 XkbServerMapMask server (1L<<1)
115 XkbIClientMapMask map (1L<<2)
116 XkbIndicatorMapMask indicators (1L<<3)
117 XkbNamesMask names (1L<<4)
118 XkbCompatMapMask compat (1L<<5)
119 XkbGeometryMask geom (1L<<6)
120 XkbAllComponentsMask All Fields (0x7f)
121
123 BadAlloc Unable to allocate storage
124
125 BadMatch A compatible version of Xkb was not available in the
126 server or an argument has correct type and range, but is
127 otherwise invalid
128
130 XkbGetNames(3), XkbSetNames(3)
131
132
133
134X Version 11 libX11 1.8.7 XkbGetVirtualMods(3)