XkbGetIndicatorChanges(3)
π XkbGetIndicatorChanges(3) π
okay bestie, so this is a page from the XKB FUNCTIONS manual, and it's all about XkbGetIndicatorChanges β yes queen, the glow-up of your local keyboard description β¨
πΈ NAME πΈ
XkbGetIndicatorChanges β updates a local copy of the keyboard description with the actual values of one or more calls to XkbNoteIndicatorChanges π
β¨ SYNOPSIS β¨
Status XkbGetIndicatorChanges (Display *dpy, XkbDescPtr xkb,
XkbIndicatorChangesPtr changes, unsigned int state);
π ARGUMENTS π
dpyβ your connection to the X server, the whole group chat link basically π¦xkbβ the keyboard description that's gonna hold all the new values πchangesβ the indicator maps/state we're obtaining from the server πstateβ backfilled with the state of the indicators β not me, it just gets filled in, no cap π
π DESCRIPTION π
So here's the tea. Whenever an indicator changes state, the server sends XkbIndicatorStateNotify events to all interested clients. And similarly β yes, same energy β whenever an indicator's map changes, the server sends XkbIndicatorMapNotify events to all interested clients. the way it just notifies everybody who's interested, iconic behavior honestly π
To receive XkbIndicatorStateNotify events, use XkbSelectEvents with both the bits_to_change and values_for_bits parameters containing XkbIndicatorStateNotifyMask. To receive XkbIndicatorMapNotify events, use XkbSelectEvents with XkbIndicatorMapNotifyMask. two different masks, two different vibes, pick your fighter β¨
To receive events for only specific indicators, use XkbSelectEventDetails. Set the event_type parameter to XkbIndicatorStateNotify or XkbIndicatorMapNotify, and set both the bits_to_change and values_for_bits detail parameters to a mask where each bit specifies one indicator β turning on those bits that specify the indicators for which you want to receive events. it's giving very precise, very demure, very selective π
Both types of indicator events use the same structure:
typedef struct _XkbIndicatorNotify {
int type; /* Xkb extension base event code */
unsigned long serial; /* X server serial number for event */
Bool send_event; /* True => synthetically generated */
Display * display; /* server connection where event generated */
Time time; /* server time when event generated */
int xkb_type; /* specifies state or map notify */
int device; /* Xkb device ID, will not be XkbUseCoreKbd */
unsigned int changed; /* mask of indicators with new state or map */
unsigned int state; /* current state of all indicators */
} XkbIndicatorNotifyEvent;
xkb_type is either XkbIndicatorStateNotify or XkbIndicatorMapNotify, depending on whether the event is a kbIndicatorStateNotify event or kbIndicatorMapNotify event. π¦
The changed parameter is a mask that is the bitwise inclusive OR of the indicators that have changed. If the event is of type XkbIndicatorMapNotify, changed reports the maps that changed. If the event is of type XkbIndicatorStateNotify, changed reports the indicators that have changed state. And state is a mask that specifies the current state of all indicators β whether they have changed or not β for both XkbIndicatorStateNotify and IndicatorMapNotify events. changed = what moved, state = the whole picture, don't mix them up bestie π
When your client application receives either a XkbIndicatorStateNotify event or XkbIndicatorMapNotify event, you can note the changes in a changes structure by calling XkbNoteIndicatorChanges. note it down, like a good student π
XkbGetIndicatorChanges examines the changes parameter, pulls over the necessary information from the server, and copies the results into the xkb keyboard description. If any bits are set in the state_changes field of changes, XkbGetIndicatorChanges also places the state of those indicators in state. If the indicators field of xkb is NULL, XkbGetIndicatorChanges allocates and initializes it. To free the indicators field, use XkbFreeIndicators. so if you see a NULL there, that's not a bug, that's the function doing its little side quest π
π DIAGNOSTICS π
BadAllocβ Unable to allocate storage π the storage said noBadImplementationβ Invalid reply from server π the server is being weird, not your faultBadMatchβ A compatible version of Xkb was not available in the server or an argument has correct type and range, but is otherwise invalid π type and range are fine but the vibe check failed, embarrassing
π SEE ALSO π
XkbFreeIndicators(3)XkbGetIndicatorChanges(3)XkbNoteIndicatorChanges(3)XkbSelectEvents(3)XkbSelectEventDetail(3)
go read those too, they're part of the lore π§
and that's the whole page bestie, you ate it, no crumbs π
this lil masterpiece comes from X Version 11, libX11 1.8.4, and it's the XkbGetIndicatorChanges(3) page β so if you cite it, cite it correctly, 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