XkbAllocDeviceLedInfo(3)
β¨ XkbAllocDeviceLedInfo β¨
okay bestie, welcome to the XKB FUNCTIONS corner of the manual, this is XkbAllocDeviceLedInfo(3) and it's genuinely so useful, come sit with me π
πΈ NAME πΈ
XkbAllocDeviceLedInfo β grab yourself an XkbDeviceLedInfoRec structure, no cap
π SYNOPSIS π
Status XkbAllocDeviceLedInfo (XkbDeviceInfoPtr device_info, int
num_needed);
π¦ ARGUMENTS π¦
device_infoβ the structure where the LED space is gonna get allocated. it's giving "put it here please" β¨num_neededβ how many indicators you want space for. the vibes-based count, basically π
π DESCRIPTION π
So XkbAllocDeviceLedInfo allocates space for an XkbDeviceLedInfoRec and places it in device_info. iconic behaviour, truly.
If num_needed is nonzero, then num_needed XkbIndicatorMapRec structures get allocated too and linked right into the XkbDeviceLedInfoRec structure. π«Ά
β οΈ but listen, bestie β if you request XkbIndicatorMapRec structures be allocated using this request, you must initialize them explicitly. no skipping that, fr fr. all the other fields get initialized to zero though, so that part's chill π
To initialize an XkbDeviceLedInfoRec structure, use XkbAddDeviceLedInfo. that's your girl for that job π
π§ STRUCTURES π§
Information about X Input Extension devices gets transferred between a client program and the Xkb extension inside an XkbDeviceInfoRec structure, and here's exactly what she looks like π
typedef struct {
char * name; /* name for device */
Atom type; /* name for class of devices */
unsigned short device_spec; /* device of interest */
Bool has_own_state; /* True=>this device has its own state */
unsigned short supported; /* bits indicating supported capabilities */
unsigned short unsupported; /* bits indicating unsupported capabilities */
unsigned short num_btns; /* number of entries in btn_acts */
XkbAction * btn_acts; /* button actions */
unsigned short sz_leds; /* total number of entries in LEDs vector */
unsigned short num_leds; /* number of valid entries in LEDs vector */
unsigned short dflt_kbd_fb; /* input extension ID of default (core kbd) indicator */
unsigned short dflt_led_fb; /* input extension ID of default indicator feedback */
XkbDeviceLedInfoPtr leds; /* LED descriptions */
} XkbDeviceInfoRec, *XkbDeviceInfoPtr;
typedef struct {
unsigned short led_class; /* class for this LED device*/
unsigned short led_id; /* ID for this LED device */
unsigned int phys_indicators; /* bits for which LEDs physically present */
unsigned int maps_present; /* bits for which LEDs have maps in maps */
unsigned int names_present; /* bits for which LEDs are in names */
unsigned int state; /* 1 bit => corresponding LED is on */
Atom names[XkbNumIndicators]; /* names for LEDs */
XkbIndicatorMapRec maps; /* indicator maps for each LED */
} XkbDeviceLedInfoRec, *XkbDeviceLedInfoPtr;
Every indicator has its own lil set of attributes that say whether clients can explicitly set its state and whether it tracks the keyboard state. the way that these attributes live in the maps array β which is an array of XkbIndicatorRec structures β is honestly so neat β¨
typedef struct {
unsigned char flags; /* how the indicator can be changed */
unsigned char which_groups; /* match criteria for groups */
unsigned char groups; /* which keyboard groups the indicator watches */
unsigned char which_mods; /* match criteria for modifiers */
XkbModsRec mods; /* which modifiers the indicator watches */
unsigned int ctrls; /* which controls the indicator watches */
} XkbIndicatorMapRec, *XkbIndicatorMapPtr;
This indicator map specifies, for each indicator:
- The conditions under which the keyboard modifier state affects the indicator
- The conditions under which the keyboard group state affects the indicator
- The conditions under which the state of the boolean controls affects the indicator
- The effect (if any) of attempts to explicitly change the state of the indicator using the functions
XkbSetControlsorXChangeKeyboardControl
π SEE ALSO π
XkbAddDeviceLedInfo(3), XkbSetControls(3)
aaaand that's the whole page, you ate it π
X Version 11 Β· libX11 1.8.4 β that's the source and version bestie, go forth and allocate responsibly, ily, periodt π π
π¦ where this page comes from
- debian bookworm: libx11-doc 2:1.8.4-2+deb12u2
- Copyright (c) 1999, Oracle and/or its affiliates
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms