1XkbSetDeviceInfo(3) XKB FUNCTIONS XkbSetDeviceInfo(3)
2
3
4
6 XkbSetDeviceInfo - Modify some or all of the characteristics of an X
7 Input Extension device
8
10 Bool XkbSetDeviceInfo (Display *dpy, unsigned int which, XkbDeviceIn‐
11 foPtr device_info);
12
14 dpy connection to X server
15
16 which mask indicating characteristics to modify
17
18 device_info
19 structure defining the device and modifications
20
22 To change characteristics of an X Input Extension device in the server,
23 first modify a local copy of the device structure and then use either
24 XkbSetDeviceInfo, or, to save network traffic, use an XkbDeviceChanges‐
25 Rec structure and call XkbChangeDeviceInfo to download the changes to
26 the server.
27
28 XkbSetDeviceInfo sends a request to the server to modify the character‐
29 istics of the device specified in the device_info structure. The par‐
30 ticular characteristics modified are identified by the bits set in
31 which and take their values from the relevant fields in device_info
32 (see Table 1). XkbSetDeviceInfo returns True if the request was suc‐
33 cessfully sent to the server. If the X server implementation does not
34 allow interaction between the X input extension and the Xkb Extension,
35 the function does nothing and returns False.
36 Table 1 XkbDeviceInfoRec Mask Bits
37 ____________________________________________________________________________________
38 Name XkbDeviceInfoRec Value Capability If Set
39 Fields Effected
40 ____________________________________________________________________________________
41 XkbXI_KeyboardsMask (1L <<0) Clients can use all
42 Xkb requests and events
43 with KeyClass devices
44 supported by the input
45 device extension.
46
47 XkbXI_ButtonActionsMask num_btns (1L <<1) Clients can assign key
48 btn_acts actions to buttons
49 non-KeyClass input
50 extension devices.
51
52 XkbXI_IndicatorNamesMask leds->names (1L <<2) Clients can assign
53 names to indicators on
54 non-KeyClass input
55 extension devices.
56
57 XkbXI_IndicatorMapsMask leds->maps (1L <<3) Clients can assign
58 indicator maps to
59 indicators on
60 non-KeyClass input
61 extension devices.
62
63 XkbXI_IndicatorStateMask leds->state (1L <<4) Clients can request
64 the status of indicators
65 on non-KeyClass input
66 extension devices.
67
68 XkbXI_IndicatorsMask sz_leds (0x1c) XkbXI_IndicatorNamesMask |
69 num_leds XkbXI_IndicatorMapsMask |
70 leds->* XkbXI_IndicatorStateMask
71
72 XkbXI_UnsupportedFeaturesMask unsupported (1L <<15)
73
74 XkbXI_AllDeviceFeaturesMask Those selected (0x1e) XkbXI_IndicatorsMask |
75 by Value Column XkbSI_ButtonActionsMask
76 masks
77
78 XkbXI_AllFeaturesMask Those selected (0x1f) XkbSI_AllDeviceFeaturesMask |
79 by Value Column XkbSI_KeyboardsMask
80 masks
81
82 XkbXI_AllDetailsMask Those selected (0x801f) XkbXI_AllFeaturesMask |
83 by Value column XkbXI_UnsupportedFeaturesMask
84 masks
85
86 The which parameter specifies which aspects of the device should be
87 changed and is a bitmask composed of an inclusive OR or one or more of
88 the following bits: XkbXI_ButtonActionsMask, XkbXI_IndicatorNamesMask,
89 XkbXI_IndicatorMapsMask. If the features requested to be manipulated in
90 which are valid for the device, but the server does not support assign‐
91 ment of one or more of them, that particular portion of the request is
92 ignored.
93
94 If the device specified in device_info->device_spec does not contain
95 buttons and a request affecting buttons is made, or the device does not
96 contain indicators and a request affecting indicators is made, a Bad‐
97 Match protocol error results.
98
99 If the XkbXI_ButtonActionsMask bit is set in the supported mask re‐
100 turned by XkbGetDeviceInfo, the Xkb extension allows applications to
101 assign key actions to buttons on input extension devices other than the
102 core keyboard device. If the XkbXI_ButtonActionsMask is set in which,
103 the actions for all buttons specified in device_info are set to the Xk‐
104 bActions specified in device_info->btn_acts. If the number of buttons
105 requested to be updated is not valid for the device, XkbSetDeviceInfo
106 returns False and a BadValue protocol error results.
107
108 If the XkbXI_IndicatorMaps and / or XkbXI_IndicatorNamesMask bit is set
109 in the supported mask returned by XkbGetDeviceInfo, the Xkb extension
110 allows applications to assign maps and / or names to the indicators of
111 nonkeyboard extension devices. If supported, maps and / or names can be
112 assigned to all extension device indicators, whether they are part of a
113 keyboard feedback or part of an indicator feedback.
114
115 If the XkbXI_IndicatorMapsMask and / or XkbXI_IndicatorNamesMask flag
116 is set in which, the indicator maps and / or names for all de‐
117 vice_info->num_leds indicator devices specified in device_info->leds
118 are set to the maps and / or names specified in device_info->leds. de‐
119 vice_info->leds->led_class and led_id specify the input extension class
120 and device ID for each indicator device to modify; if they have invalid
121 values, a BadValue protocol error results and XkbSetDeviceInfo returns
122 False. If they have legal values but do not specify a keyboard or indi‐
123 cator class feedback for the device in question, a BadMatch error re‐
124 sults. If any of the values in device_info->leds->names are not a
125 valid Atom or None, a BadAtom protocol error results.
126
128 True The XkbSetDeviceInfo function returns True if the re‐
129 quest was successfully sent to the server.
130
131 False The XkbSetDeviceInfo function returns False if the X
132 server implementation does not allow interaction between
133 the X input extension and the Xkb Extension.
134
136 Changes to an Xkb extension device may be tracked by listening to Xkb‐
137 DeviceExtensionNotify events and accumulating the changes in an XkbDe‐
138 viceChangesRec structure. The changes noted in the structure may then
139 be used in subsequent operations to update either a server configura‐
140 tion or a local copy of an Xkb extension device configuration. The
141 changes structure is defined as follows:
142
143 typedef struct _XkbDeviceChanges {
144 unsigned int changed; /* bits indicating what has changed */
145 unsigned short first_btn; /* number of first button which changed, if any */
146 unsigned short num_btns; /* number of buttons that have changed */
147 XkbDeviceLedChangesRec leds;
148 } XkbDeviceChangesRec,*XkbDeviceChangesPtr;
149
150
152 BadAtom A name is neither a valid Atom or None
153
154 BadMatch A compatible version of Xkb was not available in the
155 server or an argument has correct type and range, but is
156 otherwise invalid
157
158 BadValue An argument is out of range
159
161 XkbChangeDeviceInfo(3), XkbGetDeviceInfo(3)
162
163
164
165X Version 11 libX11 1.8.7 XkbSetDeviceInfo(3)