1XkbSetServerInternalMods(3) XKB FUNCTIONS XkbSetServerInternalMods(3)
2
3
4
6 XkbSetServerInternalMods - Sets the modifiers that are consumed by the
7 server before events are delivered to the client
8
10 Bool XkbSetServerInternalMods (Display *display, unsigned int de‐
11 vice_spec, unsigned int affect_real, unsigned int real_values,
12 unsigned int affect_virtual, unsigned int virtual_values);
13
15 - display
16 connection to the X server
17
18 - device_spec
19 device ID, or XkbUseCoreKbd
20
21 - affect_real
22 mask of real modifiers affected by this call
23
24 - real_values
25 values for affected real modifiers (1=>set, 0=>unset)
26
27 - affect_virtual
28 mask of virtual modifiers affected by this call
29
30 - virtual_values
31 values for affected virtual modifiers (1=>set, 0=>unset)
32
34 The core protocol does not provide any means to prevent a modifier from
35 being reported in events sent to clients; Xkb, however makes this pos‐
36 sible via the InternalMods control. It specifies modifiers that should
37 be consumed by the server and not reported to clients. When a key is
38 pressed and a modifier that has its bit set in the InternalMods control
39 is reported to the server, the server uses the modifier when determin‐
40 ing the actions to apply for the key. The server then clears the bit,
41 so it is not actually reported to the client. In addition, modifiers
42 specified in the InternalMods control are not used to determine grabs
43 and are not used to calculate core protocol compatibility state.
44
45 Manipulate the InternalMods control via the internal field in the Xkb‐
46 ControlsRec structure, using XkbSetControls and XkbGetControls. Alter‐
47 natively, use XkbSetServerInternalMods.
48
49 XkbSetServerInternalMods sends a request to the server to change the
50 internal modifiers consumed by the server. affect_real and real_values
51 are masks of real modifier bits indicating which real modifiers are to
52 be added and removed from the server's internal modifiers control. Mod‐
53 ifiers selected by both affect_real and real_values are added to the
54 server's internal modifiers control; those selected by affect_real but
55 not by real_values are removed from the server's internal modifiers
56 mask. Valid values for affect_real and real_values consist of any com‐
57 bination of the eight core modifier bits: ShiftMask, LockMask, Control‐
58 Mask, Mod1Mask - Mod5Mask. affect_virtual and virtual_values are masks
59 of virtual modifier bits indicating which virtual modifiers are to be
60 added and removed from the server's internal modifiers control. Modi‐
61 fiers selected by both affect_virtual and virtual_values are added to
62 the server's internal modifiers control; those selected by affect_vir‐
63 tual but not by virtual_values are removed from the server's internal
64 modifiers control. See below for a discussion of virtual modifier masks
65 to use in affect_virtual and virtual_values. XkbSetServerInternalMods
66 does not wait for a reply from the server. It returns True if the re‐
67 quest was sent and False otherwise.
68
69 Virtual modifiers are named by converting their string name to an X
70 Atom and storing the Atom in the names.vmods array in an XkbDescRec
71 structure. The position of a name Atom in the names.vmods array defines
72 the bit position used to represent the virtual modifier and also the
73 index used when accessing virtual modifier information in arrays: the
74 name in the i-th (0 relative) entry of names.vmods is the i-th virtual
75 modifier, represented by the mask (1<<i). Throughout Xkb, various func‐
76 tions have a parameter that is a mask representing virtual modifier
77 choices. In each case, the i-th bit (0 relative) of the mask represents
78 the i-th virtual modifier.
79
80 To set the name of a virtual modifier, use XkbSetNames, using XkbVir‐
81 tualModNamesMask in which and the name in the xkb argument; to retrieve
82 indicator names, use XkbGetNames.
83
85 The complete description of an Xkb keyboard is given by an XkbDescRec.
86 The component structures in the XkbDescRec represent the major Xkb com‐
87 ponents outlined in Figure 1.1.
88
89 typedef struct {
90 struct _XDisplay * display; /* connection to X server */
91 unsigned short flags; /* private to Xkb, do not modify */
92 unsigned short device_spec; /* device of interest */
93 KeyCode min_key_code; /* minimum keycode for device */
94 KeyCode max_key_code; /* maximum keycode for device */
95 XkbControlsPtr ctrls; /* controls */
96 XkbServerMapPtr server; /* server keymap */
97 XkbClientMapPtr map; /* client keymap */
98 XkbIndicatorPtr indicators; /* indicator map */
99 XkbNamesPtr names; /* names for all components */
100 XkbCompatMapPtr compat; /* compatibility map */
101 XkbGeometryPtr geom; /* physical geometry of keyboard */
102 } XkbDescRec, *XkbDescPtr;
103
104 The display field points to an X display structure. The flags field is
105 private to the library: modifying flags may yield unpredictable re‐
106 sults. The device_spec field specifies the device identifier of the
107 keyboard input device, or XkbUseCoreKeyboard, which specifies the core
108 keyboard device. The min_key_code and max_key_code fields specify the
109 least and greatest keycode that can be returned by the keyboard.
110
111 Each structure component has a corresponding mask bit that is used in
112 function calls to indicate that the structure should be manipulated in
113 some manner, such as allocating it or freeing it. These masks and their
114 relationships to the fields in the XkbDescRec are shown in Table 1.
115
116
117 Table 1 Mask Bits for XkbDescRec
118 ──────────────────────────────────────────────────
119 Mask Bit XkbDescRec Field Value
120 ──────────────────────────────────────────────────
121 XkbControlsMask ctrls (1L<<0)
122 XkbServerMapMask server (1L<<1)
123 XkbIClientMapMask map (1L<<2)
124 XkbIndicatorMapMask indicators (1L<<3)
125 XkbNamesMask names (1L<<4)
126 XkbCompatMapMask compat (1L<<5)
127 XkbGeometryMask geom (1L<<6)
128 XkbAllComponentsMask All Fields (0x7f)
129
131 XkbGetControls(3), XkbGetNames(3), XkbSetControls(3), XkbSetNames(3)
132
133
134
135X Version 11 libX11 1.7.2 XkbSetServerInternalMods(3)