XkbSetControls(3)
π¦ NAME π¦
okay so welcome to XkbSetControls from the XKB FUNCTIONS section (section 3, bestie π
) β it copies changes to the X server based on a modified ctrls structure in a local copy of the keyboard description. that's the whole vibe. no cap.
β¨ SYNOPSIS β¨
Bool XkbSetControls (Display *display, unsigned long which, XkbDescPtr
xkb);
π ARGUMENTS π
- display β connection to X server. the whole reason we're here π«Ά
- which β mask of controls requested. it's giving "pick your fighters" energy β
- xkb β keyboard description for controls information. this is where the
ctrlstea lives π
π DESCRIPTION π
so for each bit that's set in the which parameter, XkbSetControls sends the corresponding values from the xkb->ctrls field to the server. literally bit by bit, she's delivering π¦β¨
valid values for which are any combination of the masks listed in Table 1 that have "ok" in the which column. iykyk π
Table 1 shows the actual values for the individual mask bits used to select controls for modification and to enable and disable the control. note (and this is the important part, don't skip it π) that the same mask bit is used to specify general modifications to the parameters used to configure the control (which), and to enable and disable the control (enabled_ctrls).
the anomalies in the table (the rows with no "ok" in the column) are for controls that have no configurable attributes; and for controls that are not boolean controls and therefore cannot be enabled or disabled. lowkey rude of them but ok π
π Table 1 β Controls Mask Bits π
each bullet is one mask bit, showing whether it's "ok" in which or changed_ctrls, whether it's "ok" in enabled_ctrls, and its value β¨
XkbRepeatKeysMaskβwhich or changed_ctrls: ok Β·enabled_ctrls: ok Β· value(1L<<0)XkbSlowKeysMaskβwhich or changed_ctrls: ok Β·enabled_ctrls: ok Β· value(1L<<1)XkbBounceKeysMaskβwhich or changed_ctrls: ok Β·enabled_ctrls: ok Β· value(1L<<2)XkbStickyKeysMaskβwhich or changed_ctrls: ok Β·enabled_ctrls: ok Β· value(1L<<3)XkbMouseKeysMaskβwhich or changed_ctrls: ok Β·enabled_ctrls: ok Β· value(1L<<4)XkbMouseKeysAccelMaskβwhich or changed_ctrls: ok Β·enabled_ctrls: ok Β· value(1L<<5)XkbAccessXKeysMaskβwhich or changed_ctrls: ok Β·enabled_ctrls: ok Β· value(1L<<6)XkbAccessXTimeoutMaskβwhich or changed_ctrls: ok Β·enabled_ctrls: ok Β· value(1L<<7)XkbAccessXFeedbackMaskβwhich or changed_ctrls: ok Β·enabled_ctrls: ok Β· value(1L<<8)XkbAudibleBellMaskβwhich or changed_ctrls: (blank β not ok) Β·enabled_ctrls: ok Β· value(1L<<9)XkbOverlay1Maskβwhich or changed_ctrls: (blank β not ok) Β·enabled_ctrls: ok Β· value(1L<<10)XkbOverlay2Maskβwhich or changed_ctrls: (blank β not ok) Β·enabled_ctrls: ok Β· value(1L<<11)XkbIgnoreGroupLockMaskβwhich or changed_ctrls: (blank β not ok) Β·enabled_ctrls: ok Β· value(1L<<12)XkbGroupsWrapMaskβwhich or changed_ctrls: ok Β·enabled_ctrls: (blank β not ok) Β· value(1L<<27)XkbInternalModsMaskβwhich or changed_ctrls: ok Β·enabled_ctrls: (blank β not ok) Β· value(1L<<28)XkbIgnoreLockModsMaskβwhich or changed_ctrls: ok Β·enabled_ctrls: (blank β not ok) Β· value(1L<<29)XkbPerKeyRepeatMaskβwhich or changed_ctrls: ok Β·enabled_ctrls: (blank β not ok) Β· value(1L<<30)XkbControlsEnabledMaskβwhich or changed_ctrls: ok Β·enabled_ctrls: (blank β not ok) Β· value(1L<<31)XkbAccessXOptionsMaskβwhich or changed_ctrls: ok Β·enabled_ctrls: ok Β· value(XkbStickyKeysMask | XkbAccessXFeedbackMask)XkbAllBooleanCtrlsMaskβwhich or changed_ctrls: (blank β not ok) Β·enabled_ctrls: ok Β· value(0x00001FFF)XkbAllControlsMaskβwhich or changed_ctrls: ok Β·enabled_ctrls: (blank β not ok) Β· value(0xF8001FFF)
π§ the fail conditions, gather round π§
if xkb->ctrls is NULL, or the server does not support a compatible version of Xkb, or the Xkb extension has not been properly initialized, XkbSetControls returns False. otherwise, it sends the request to the X server and returns True. and that's it, that's the whole storyline ππ
π control attributes β the lore π
note that changes to attributes of controls in the XkbControlsRec structure are apparent only when the associated control is enabled, although the corresponding values are still updated in the X server. for example, the repeat_delay and repeat_interval fields are ignored unless the RepeatKeys control is enabled (that is, the X server's equivalent of xkb->ctrls has XkbRepeatKeyMask set in enabled_ctrls). ngl that's the fine print, read it twice π
it is permissible to modify the attributes of a control in one call to XkbSetControls and enable the control in a subsequent call. see XkbChangeEnabledControls for more information on enabling and disabling controls. spread it out, she doesn't mind β¨
β enabled_ctrls is itself a control β plot twist β
note that the enabled_ctrls field is itself a control β the EnabledControls control. as such, to set a specific configuration of enabled and disabled boolean controls, you must set enabled_ctrls to the appropriate bits to enable only the controls you want and disable all others, then specify the XkbControlsEnabledMask in a call to XkbSetControls. main character energy, honestly π₯
because this is somewhat awkward if all you want to do is enable and disable controls, and not modify any of their attributes, a convenience function is also provided for this purpose, XkbChangeEnabledControls. she's the shortcut bestie π«Ά
π RETURN VALUES π
Trueβ theXkbSetControlsfunction returnsTruewhen it sends the request to the X server. slay βFalseβ theXkbSetControlsfunction returnsFalsewhenxkb->ctrlsisNULL, the server does not support a compatible version of Xkb, or the Xkb extension has not been properly initialized. sad girl hours π
πΈ DIAGNOSTICS πΈ
BadAllocβ unable to allocate storage. out of room, no vibe πBadMatchβ a compatible version of Xkb was not available in the server or an argument has correct type and range, but is otherwise invalid. right shape, wrong energy π
π SEE ALSO π
go read them, they're the supporting cast π
ok that's the whole page, you ate that π no notes.
mwah π this has been X Version 11, libX11 1.8.14, XkbSetControls(3) β catch you in the next manpage bestie πβ¨π
π¦ where this page comes from
- alpine 3.24: libx11-doc 1.8.14-r0 Β· X11
- arch rolling: libx11 1.8.14-1 Β· MIT AND X11
- nixos 26.05: libx11 1.8.14
- nixpkgs unstable: libx11 1.8.14
- Copyright (c) 1999, Oracle and/or its affiliates
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms