XkbSetXlibControls(3)

✨ XkbSetXlibControls β€” the XKB functions era ✨

okay so bestie, quick vibe check: this is a page from the XKB FUNCTIONS section of the manual (yes, the whole section, it's giving very library-core πŸ’…), and it's about XkbSetXlibControls. Buckle up, it's short but it eats. πŸŽ€


πŸ¦‹ NAME πŸ¦‹

XkbSetXlibControls β€” literally changes the state of the Library Controls. that's it, that's the whole job. no cap.


🌸 SYNOPSIS 🌸

unsigned int XkbSetXlibControls (Display *display, unsigned long
       bits_to_change, unsigned long values_for_bits);

like, it returns an unsigned int and takes three things. iconic signature honestly.


πŸ’– ARGUMENTS πŸ’–

  • display β€” the connection to the X server. your whole link to the mothership basically. πŸ›Έ
  • bits_to_change β€” this one selects which controls get modified. it's the "who's getting the makeover" list.
  • values_for_bits β€” turns the selected controls on (1) or off (0). the on/off switch energy. πŸ”₯

🌈 DESCRIPTION 🌈

so XkbSetXlibControls modifies the state of the controls selected by bits_to_change. key detail: only the controls selected by bits_to_change are modified β€” everyone else stays exactly where they were, minding their own business. 🫢

the rules, fr fr:

  • if the bit corresponding to a control is on in bits_to_change AND also on in values_for_bits β†’ the control is enabled. slay. ✨
  • if the bit corresponding to a control is on in bits_to_change but off in values_for_bits β†’ the control is disabled. πŸ’€

and bits_to_change should be an inclusive OR of bits from Table 1, which is right here:

πŸŽ€ Table 1 Library Control Masks πŸŽ€

Library Control Mask              Value
───────────────────────────────────────────────
XkbLC_ForceLatin1Lookup           (1 << 0)
XkbLC_ConsumeLookupMods           (1 << 1)
XkbLC_AlwaysConsumeShiftAndLock   (1 << 2)
XkbLC_IgnoreNewKeyboards          (1 << 3)
XkbLC_ConsumeKeysOnComposeFail    (1 << 29)
XkbLC_ComposeLED                  (1 << 30)
XkbLC_BeepOnComposeFail           (1 << 31)
XkbLC_AllControls                 (0xc0000007)

not the bits being all dramatic with jumps from 3 straight to 29 😭 but okay, we respect the design choices.


πŸ‘‘ RETURN VALUES πŸ‘‘

yes bestie, the return values are literally just the masks again β€” here's the full rundown so nothing gets lost:

  • (1 << 0) β€” XkbLC_ForceLatin1Lookup
  • (1 << 1) β€” XkbLC_ConsumeLookupMods
  • (1 << 2) β€” XkbLC_AlwaysConsumeShiftAndLock
  • (1 << 3) β€” XkbLC_IgnoreNewKeyboards
  • (1 << 29) β€” XkbLC_ConsumeKeysOnComposeFail
  • (1 << 30) β€” XkbLC_ComposeLED
  • (1 << 31) β€” XkbLC_BeepOnComposeFail
  • (0xc0000007) β€” XkbLC_AllControls

reminder: keep bits_to_change as an inclusive OR of those Table 1 bits, and remember only the selected controls move. everything else stays untouched. that's the whole personality of this function. πŸ’…

and that's the page!! 🌟 sourced from X Version 11, libX11 1.8.14, dated with XkbSetXlibControls(3) at the bottom β€” mwah, bye bestie, go set some controls πŸ’œπŸ§š

πŸ“¦ where this page comes from