XkbGetStickyKeysOptions(3)
π XkbGetStickyKeysOptions β the libX11 girlies' guide π
okay so bestie, this one is a <cyan>XKB FUNCTIONS</cyan> page from the <purple>libX11</purple> manual, and it's literally about asking your keyboard "hey, what's your StickyKeys vibe rn?" no cap. Let's get into it π
β¨ NAME β¨
XkbGetStickyKeysOptions β queries the current StickyKeys attributes for a keyboard device π¦
πΈ SYNOPSIS πΈ
Bool XkbGetStickyKeysOptions (Display *display, unsigned int
device_spec, unsigned int *options_rtrn);
π«Ά ARGUMENTS π«Ά
displayβ the connection to the X server, aka your lil hotline to the server πdevice_specβ the device ID, orXkbUseCoreKbdif you wanna just use the core keyboard πoptions_rtrnβ gets backfilled with the StickyKeys option mask β¨
π DESCRIPTION π
So the StickyKeys control has two options, and you can reach both of them through the ax_options field of an XkbControlsRec structure. Let's meet them π₯°
The first one is <hotpink>TwoKeys</hotpink> β it says whether StickyKeys should automatically turn off when two keys get pressed at the same time. This is lowkey iconic for shared computers, because it means people who don't want StickyKeys don't have to manually turn it off if some previous user left StickyKeys on. it's giving considerate π
The second one is <hotpink>LatchToLock</hotpink> β it says whether or not StickyKeys locks a modifier when it's pressed twice in a row. periodt.
Now, XkbGetStickyKeysOptions requests the attributes of the StickyKeys control from the server, waits for a reply (yes bestie, we wait, we're patient π§), and backfills options_rtrn with a mask that tells you whether each individual StickyKeys option is on or off.
The valid bits in options_rtrn are:
XkbAX_TwoKeysMask
XkbAX_LatchToLockMask
XkbGetStickyKeysOptions returns True if it's successful; but if a compatible version of the Xkb extension is not available in the server, XkbGetStickyKeysOptions returns False π
β RETURN VALUES β
Trueβ theXkbGetStickyKeysOptionsfunction returnsTrueif the request for the attributes of the StickyKeys control from the server was successful. slay πFalseβ theXkbGetStickyKeysOptionsfunction returnsFalseif a compatible version of the Xkb extension is not available in the server. tragic, honestly π
π STRUCTURES π
The XkbControlsRec structure is defined as follows β look at her, she's gorgeous, and she is <rainbow>verbatim</rainbow>, do not touch a single character bestie:
#define XkbMaxLegalKeyCode 255
#define XkbPerKeyBitArraySize ((XkbMaxLegalKeyCode+1)/8)
typedef struct {
unsigned char mk_dflt_btn; /* default button for keyboard driven mouse */
unsigned char num_groups; /* number of keyboard groups */
unsigned char groups_wrap; /* how to wrap out-of-bounds groups */
XkbModsRec internal; /* defines server internal modifiers */
XkbModsRec ignore_lock; /* modifiers to ignore when checking for grab */
unsigned int enabled_ctrls; /* 1 bit => corresponding boolean control enabled */
unsigned short repeat_delay; /* ms delay until first repeat */
unsigned short repeat_interval; /* ms delay between repeats */
unsigned short slow_keys_delay; /* ms minimum time key must be down to be ok */
unsigned short debounce_delay; /* ms delay before key reactivated */
unsigned short mk_delay; /* ms delay to second mouse motion event */
unsigned short mk_interval; /* ms delay between repeat mouse events */
unsigned short mk_time_to_max; /* # intervals until constant mouse move */
unsigned short mk_max_speed; /* multiplier for maximum mouse speed */
short mk_curve; /* determines mouse move curve type */
unsigned short ax_options; /* 1 bit => Access X option enabled */
unsigned short ax_timeout; /* seconds until Access X disabled */
unsigned short axt_opts_mask; /* 1 bit => options to reset on Access X timeout */
unsigned short axt_opts_values; /* 1 bit => turn option on, 0=> off */
unsigned int axt_ctrls_mask; /* which bits in enabled_ctrls to modify */
unsigned int axt_ctrls_values; /* values for new bits in enabled_ctrls */
unsigned char per_key_repeat[XkbPerKeyBitArraySize]; /* per key auto repeat */
} XkbControlsRec, *XkbControlsPtr;
fr fr, remember: if the server doesn't have a compatible Xkb extension, you get False and no backfill tea. that's just how it is π
okay that's the whole page bestie, go query those attributes, you ate π β¨
X Version 11 Β· libX11 1.8.4 Β· XkbGetStickyKeysOptions(3) β mwah, that's the version and source info, love u, bye πππ¦
π¦ 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