XkbSetAutoResetControls(3)

πŸ’… XkbSetAutoResetControls(3) β€” like, the XKB FUNCTIONS era πŸŽ€

okay so bestie, welcome to the XKB FUNCTIONS corner of the universe ✨ this one's a libX11 classic and honestly it's giving "tiny function, big feelings" energy. shall we? πŸ¦‹


🌸 NAME 🌸

XkbSetAutoResetControls β€” it changes the current values of the AutoReset control attributes. that's it. that's the whole vibe check πŸ’…


✨ SYNOPSIS ✨

Bool XkbSetAutoResetControls (Display *dpy, unsigned int changes,
       unsigned int *auto_ctrls, unsigned int *auto_values);

like, it returns a Bool, so you do get to know if it slayed or flopped 🫢


πŸŽ€ ARGUMENTS πŸŽ€

  • dpy β€” your connection to the X server. the main character, lowkey πŸ‘‘
  • changes β€” the controls you want to change auto-reset values for. this is your who's getting the makeover list πŸ’–
  • auto_ctrls β€” the controls from changes that should auto reset. so like, the shortlist πŸ¦‹
  • auto_values β€” 1 bit => auto-reset on. simple as that, no cap ⭐

πŸ”₯ DESCRIPTION πŸ”₯

so XkbSetAutoResetControls changes the auto-reset status and the associated auto-reset values for the controls selected by changes. fr fr, that's the whole plot πŸ“

here's the tea β˜• for any control selected by changes:

  • if the corresponding bit is set in auto_ctrls, that control is configured to auto-reset when the client exits πŸ’€
  • and if the corresponding bit in auto_values is on, the control is turned on when the client exits 🌈
  • if that bit is zero, the control is turned off when the client exits πŸ™ˆ

meanwhile, for any control selected by changes where the corresponding bit is not set in auto_ctrls? that control is configured to not reset when the client exits. periodt. ✨


πŸ’œ the examples, because obviously πŸ’œ

for example:

to leave the auto-reset controls for StickyKeys the way they are:
ok = XkbSetAutoResetControls(dpy, 0, 0, 0);
to change the auto-reset controls so that StickyKeys are unaffected when the client exits:
ok = XkbSetAutoResetControls(dpy, XkbStickyKeysMask, 0, 0);
to change the auto-reset controls so that StickyKeys are turned off when the client exits:
ok = XkbSetAutoResetControls(dpy, XkbStickyKeysMask, XkbStickyKeysMask, 0);
to change the auto-reset controls so that StickyKeys are turned on when the client exits:
ok = XkbSetAutoResetControls(dpy, XkbStickyKeysMask, XkbStickyKeysMask,
       XkbStickyKeysMask);

the way that last one just stacks XkbStickyKeysMask three times… iconic honestly πŸ‘‘


🧚 the backfill moment (don't skip this) 🧚

XkbSetAutoResetControls backfills auto_ctrls and auto_values with the auto-reset controls for this particular client πŸ’«

⚠️ and here's the important bit, bestie: all of the bits are valid in the returned values β€” not just the ones selected in the changes mask. like, the whole palette comes back, not just the shades you asked about πŸ’…

🌟 ok that's the page 🌟

written up all cute from the X Version 11 release of libX11 1.8.14, and that's the XkbSetAutoResetControls(3) manual page β€” mwah, go forth and auto-reset responsibly πŸ«ΆπŸ’–πŸŽ€

πŸ“¦ where this page comes from