1XkbGetVirtualMods(3)             XKB FUNCTIONS            XkbGetVirtualMods(3)
2
3
4

NAME

6       XkbGetVirtualMods  -  Obtain  a subset of the virtual modifier bindings
7       (the vmods array) in a keyboard description
8

SYNOPSIS

10       Status XkbGetVirtualMods (Display *dpy, unsigned int which,  XkbDescPtr
11              xkb);
12

ARGUMENTS

14       - dpy  connection to server
15
16       - which
17              mask indicating virtual modifier bindings to get
18
19       - xkb  Xkb description where results will be placed
20

DESCRIPTION

22       XkbGetVirtualMods sends a request to the server to obtain the vmods en‐
23       tries for the virtual modifiers specified in the mask, which, and waits
24       for a reply.
25
26       Virtual  modifiers  are  named  by converting their string name to an X
27       Atom and storing the Atom in the names.vmods  array  in  an  XkbDescRec
28       structure. The position of a name Atom in the names.vmods array defines
29       the bit position used to represent the virtual modifier  and  also  the
30       index  used  when accessing virtual modifier information in arrays: the
31       name in the i-th (0 relative) entry of names.vmods is the i-th  virtual
32       modifier, represented by the mask (1<<i). Throughout Xkb, various func‐
33       tions have a parameter that is a  mask  representing  virtual  modifier
34       choices. In each case, the i-th bit (0 relative) of the mask represents
35       the i-th virtual modifier.
36
37       To set the name of a virtual modifier, use XkbSetNames,  using  XkbVir‐
38       tualModNamesMask in which and the name in the xkb argument; to retrieve
39       indicator names, use XkbGetNames.
40
41       For each bit set in which, XkbGetVirtualMods updates the  corresponding
42       virtual modifier definition in the server->vmods array of xkb.  The xkb
43       parameter must be a pointer to a valid  Xkb  keyboard  description.  If
44       successful, XkbGetVirtualMods returns Success.
45
46       Virtual Modifier Names and Masks
47
48       Virtual  modifiers  are  named  by converting their string name to an X
49       Atom and storing the Atom in the names.vmods  array  in  an  XkbDescRec
50       structure. The position of a name Atom in the names.vmods array defines
51       the bit position used to represent the virtual modifier  and  also  the
52       index  used  when accessing virtual modifier information in arrays: the
53       name in the i-th (0 relative) entry of names.vmods is the i-th  virtual
54       modifier, represented by the mask (1<<i). Throughout Xkb, various func‐
55       tions have a parameter that is a  mask  representing  virtual  modifier
56       choices. In each case, the i-th bit (0 relative) of the mask represents
57       the i-th virtual modifier.
58
59       To set the name of a virtual modifier, use XkbSetNames,  using  XkbVir‐
60       tualModNamesMask in which and the name in the xkb argument; to retrieve
61       indicator names, use XkbGetNames.
62
63       If the server map has not been allocated  in  the  xkb  parameter,  Xk‐
64       bGetVirtualMods  allocates and initializes it before obtaining the vir‐
65       tual modifier bindings.
66
67       If the server does not have a compatible version of Xkb, or the Xkb ex‐
68       tension  has  not  been properly initialized, XkbGetVirtualMods returns
69       BadMatch. Any errors in allocation cause  XkbGetVirtualMods  to  return
70       BadAlloc.
71

RETURN VALUES

73       Success        The  XkbGetVirtualMods  function returns Success when it
74                      successfully updates the corresponding virtual  modifier
75                      definition in the server->vmods array of xkb.
76

STRUCTURES

78       The  complete description of an Xkb keyboard is given by an XkbDescRec.
79       The component structures in the XkbDescRec represent the major Xkb com‐
80       ponents.
81
82       typedef struct {
83          struct _XDisplay * display;      /∗ connection to X server */
84          unsigned short     flags;        /∗ private to Xkb, do not modify */
85          unsigned short     device_spec;  /∗ device of interest */
86          KeyCode            min_key_code; /∗ minimum keycode for device */
87          KeyCode            max_key_code; /∗ maximum keycode for device */
88          XkbControlsPtr     ctrls;        /∗ controls */
89          XkbServerMapPtr    server;       /∗ server keymap */
90          XkbClientMapPtr    map;          /∗ client keymap */
91          XkbIndicatorPtr    indicators;   /∗ indicator map */
92          XkbNamesPtr        names;        /∗ names for all components */
93          XkbCompatMapPtr    compat;       /∗ compatibility map */
94          XkbGeometryPtr     geom;         /∗ physical geometry of keyboard */
95       } XkbDescRec, *XkbDescPtr;
96
97       The  display field points to an X display structure. The flags field is
98       private to the library: modifying flags  may  yield  unpredictable  re‐
99       sults.  The  device_spec  field  specifies the device identifier of the
100       keyboard input device, or XkbUseCoreKeyboard, which specifies the  core
101       keyboard  device.  The min_key_code and max_key_code fields specify the
102       least and greatest keycode that can be returned by the keyboard.
103
104       Each structure component has a corresponding mask bit that is  used  in
105       function  calls to indicate that the structure should be manipulated in
106       some manner, such as allocating it or freeing it. These masks and their
107       relationships to the fields in the XkbDescRec are shown in Table 1.
108
109
110               Table 1 Mask Bits for XkbDescRec
111       ──────────────────────────────────────────────────
112       Mask Bit               XkbDescRec Field   Value
113       ──────────────────────────────────────────────────
114       XkbControlsMask        ctrls              (1L<<0)
115       XkbServerMapMask       server             (1L<<1)
116       XkbIClientMapMask      map                (1L<<2)
117       XkbIndicatorMapMask    indicators         (1L<<3)
118       XkbNamesMask           names              (1L<<4)
119       XkbCompatMapMask       compat             (1L<<5)
120       XkbGeometryMask        geom               (1L<<6)
121       XkbAllComponentsMask   All Fields         (0x7f)
122

DIAGNOSTICS

124       BadAlloc       Unable to allocate storage
125
126       BadMatch       A  compatible  version  of  Xkb was not available in the
127                      server or an argument has correct type and range, but is
128                      otherwise invalid
129

SEE ALSO

131       XkbGetNames(3), XkbSetNames(3)
132
133
134
135X Version 11                     libX11 1.7.0             XkbGetVirtualMods(3)
Impressum