1XkbAllocDeviceLedInfo(3) XKB FUNCTIONS XkbAllocDeviceLedInfo(3)
2
3
4
6 XkbAllocDeviceLedInfo - Obtain an XkbDeviceLedInfoRec structure
7
9 Status XkbAllocDeviceLedInfo (XkbDeviceInfoPtr device_info, int
10 num_needed);
11
13 - device_info
14 structure in which to allocate LED space
15
16 - num_needed
17 number of indicators to allocate space for
18
20 XkbAllocDeviceLedInfo allocates space for an XkbDeviceLedInfoRec and
21 places it in device_info. If num_needed is nonzero, num_needed
22 XkbIndicatorMapRec structures are also allocated and linked into the
23 XkbDeviceLedInfoRec structure. If you request XkbIndicatorMapRec struc‐
24 tures be allocated using this request, you must initialize them explic‐
25 itly. All other fields are initialized to zero.
26
27 To initialize an XkbDeviceLedInfoRec structure, use XkbAddDeviceLed‐
28 Info.
29
31 Information about X Input Extension devices is transferred between a
32 client program and the Xkb extension in an XkbDeviceInfoRec structure:
33
34 typedef struct {
35 char * name; /∗ name for device */
36 Atom type; /∗ name for class of devices */
37 unsigned short device_spec; /∗ device of interest */
38 Bool has_own_state; /∗ True=>this device has its own state */
39 unsigned short supported; /∗ bits indicating supported capabilities */
40 unsigned short unsupported; /∗ bits indicating unsupported capabilities */
41 unsigned short num_btns; /∗ number of entries in btn_acts */
42 XkbAction * btn_acts; /∗ button actions */
43 unsigned short sz_leds; /∗ total number of entries in LEDs vector */
44 unsigned short num_leds; /∗ number of valid entries in LEDs vector */
45 unsigned short dflt_kbd_fb; /∗ input extension ID of default (core kbd) indicator */
46 unsigned short dflt_led_fb; /∗ input extension ID of default indicator feedback */
47 XkbDeviceLedInfoPtr leds; /∗ LED descriptions */
48 } XkbDeviceInfoRec, *XkbDeviceInfoPtr;
49
50
51 typedef struct {
52 unsigned short led_class; /∗ class for this LED device*/
53 unsigned short led_id; /∗ ID for this LED device */
54 unsigned int phys_indicators; /∗ bits for which LEDs physically present */
55 unsigned int maps_present; /∗ bits for which LEDs have maps in maps */
56 unsigned int names_present; /∗ bits for which LEDs are in names */
57 unsigned int state; /∗ 1 bit => corresponding LED is on */
58 Atom names[XkbNumIndicators]; /∗ names for LEDs */
59 XkbIndicatorMapRec maps; /∗ indicator maps for each LED */
60 } XkbDeviceLedInfoRec, *XkbDeviceLedInfoPtr;
61
62 Each indicator has its own set of attributes that specify whether
63 clients can explicitly set its state and whether it tracks the keyboard
64 state. The attributes of each indicator are held in the maps array,
65 which is an array of XkbIndicatorRec structures:
66
67 typedef struct {
68 unsigned char flags; /∗ how the indicator can be changed */
69 unsigned char which_groups; /∗ match criteria for groups */
70 unsigned char groups; /∗ which keyboard groups the indicator watches */
71 unsigned char which_mods; /∗ match criteria for modifiers */
72 XkbModsRec mods; /∗ which modifiers the indicator watches */
73 unsigned int ctrls; /∗ which controls the indicator watches */
74 } XkbIndicatorMapRec, *XkbIndicatorMapPtr;
75
76 This indicator map specifies for each indicator:
77
78
79 · The conditions under which the keyboard modifier state affects the
80 indicator
81
82 · The conditions under which the keyboard group state affects the
83 indicator
84
85 · The conditions under which the state of the boolean controls
86 affects the indicator
87
88 · The effect (if any) of attempts to explicitly change the state of
89 the indicator using the functions XkbSetControls or XChangeKey‐
90 boardControl
91
93 XkbAddDeviceLedInfo(3), XkbSetControls(3)
94
95
96
97X Version 11 libX11 1.3.4 XkbAllocDeviceLedInfo(3)