XkbGetStickyKeysOptions(3)

πŸ“¦
version 1.8.4 Β· 2 versions
, in debian bookworm

πŸ’– 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, or XkbUseCoreKbd if 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 β€” the XkbGetStickyKeysOptions function returns True if the request for the attributes of the StickyKeys control from the server was successful. slay πŸ’…
  • False β€” the XkbGetStickyKeysOptions function returns False if 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