XkbChangeControls(3)

πŸ’… XkbChangeControls(3) β€” XKB FUNCTIONS πŸ’…

okay bestie, welcome to the XkbChangeControls(3) page from the XKB FUNCTIONS manual. It’s giving β€œupdate the server’s controls to match the changed keyboard description,” and lowkey that’s a whole vibe. πŸ’–

🌸 NAME 🌸

XkbChangeControls β€” Provides a flexible method for updating the controls in a server to match those in the changed keyboard description. slay.

✨ SYNOPSIS ✨

no cap, this is the exact call signature:

Bool XkbChangeControls (Display *dpy, XkbDescPtr xkb,
       XkbControlsChangesPtr changes);

πŸŽ€ ARGUMENTS πŸŽ€

vibe check on the arguments:

  • dpy β€” connection to X server.
  • xkb β€” keyboard description with changed xkb->ctrls.
  • changes β€” which parts of xkb->ctrls have changed.

πŸ’œ DESCRIPTION πŸ’œ

Okay so the XkbControlsChangesRec structure allows applications to track modifications to an XkbControlsRec structure and thereby reduce the amount of traffic sent to the server. The same XkbControlsChangesRec structure may be used in several successive modifications to the same XkbControlsRec structure, then subsequently used to cause all of the changes, and only the changes, to be propagated to the server. efficient queen behavior πŸ’…

The changed_ctrls field is a mask specifying which logical sets of data in the controls structure have been modified. In this context, modified means set β€” that is, if a value is set to the same value it previously contained, it has still been modified, and is noted as changed. Valid values for changed_ctrls are any combination of the masks listed in Table 1 that have "ok" in the changed_ctrls column. Setting a bit implies the corresponding data fields from the "Relevant XkbControlsRec Data Fields" column in Table 1 have been modified. The enabled_ctrls_changes field specifies which bits in the enabled_ctrls field have changed. If the number of keyboard groups has changed, the num_groups_changed field is set to True.

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 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 (no "ok" in column) are for controls that have no configurable attributes; and for controls that are not boolean controls and therefore cannot be enabled or disabled.

πŸ¦‹ Table 1 Xkb Controls πŸ¦‹

  • AccessXFeedback β€” control selection mask (which parameter): XkbAccessXFeedbackMask; relevant XkbControlsRec data fields: ax_options: XkbAX_*FBMask; boolean control enabled_ctrls bit: XkbAccessXFeedbackMask; section: 10.6.3.
  • AccessXKeys β€” control selection mask (which parameter): β€”; relevant XkbControlsRec data fields: β€”; boolean control enabled_ctrls bit: XkbAccessXKeysMask; section: 10.6.1.
  • AccessXTimeout β€” control selection mask (which parameter): XkbAccessXTimeoutMask; relevant XkbControlsRec data fields: ax_timeout, axt_opts_mask, axt_opts_values, axt_ctrls_mask, axt_ctrls_values; boolean control enabled_ctrls bit: XkbAccessXTimeoutMask; section: 10.6.2.
  • AudibleBell β€” control selection mask (which parameter): β€”; relevant XkbControlsRec data fields: β€”; boolean control enabled_ctrls bit: XkbAudibleBellMask; section: 9.2.
  • AutoReset β€” control selection mask (which parameter): β€”; relevant XkbControlsRec data fields: β€”; boolean control enabled_ctrls bit: β€”; section: 10.1.2.
  • BounceKeys β€” control selection mask (which parameter): XkbBounceKeysMask; relevant XkbControlsRec data fields: debounce_delay; boolean control enabled_ctrls bit: XkbBounceKeysMask; section: 10.6.7.
  • Detectable-Autorepeat β€” control selection mask (which parameter): β€”; relevant XkbControlsRec data fields: β€”; boolean control enabled_ctrls bit: β€”; section: 10.3.3.
  • EnabledControls β€” control selection mask (which parameter): XkbControlsEnabledMask; relevant XkbControlsRec data fields: enabled_ctrls; boolean control enabled_ctrls bit: Non-Boolean Control; section: 10.1.1.
  • GroupsWrap β€” control selection mask (which parameter): XkbGroupsWrapMask; relevant XkbControlsRec data fields: groups_wrap; boolean control enabled_ctrls bit: Non-Boolean Control; section: 10.7.1.
  • IgnoreGroupLock β€” control selection mask (which parameter): β€”; relevant XkbControlsRec data fields: β€”; boolean control enabled_ctrls bit: XkbIgnoreGroupLockMask; section: 10.7.3.
  • IgnoreLockMods β€” control selection mask (which parameter): XkbIgnoreLockModsMask; relevant XkbControlsRec data fields: ignore_lock; boolean control enabled_ctrls bit: Non-Boolean Control; section: 5.1.
  • InternalMods β€” control selection mask (which parameter): XkbInternalModsMask; relevant XkbControlsRec data fields: internal; boolean control enabled_ctrls bit: Non-Boolean Control; section: 5.1.
  • MouseKeys β€” control selection mask (which parameter): XkbMouseKeysMask; relevant XkbControlsRec data fields: mk_dflt_btn; boolean control enabled_ctrls bit: XkbMouseKeysMask; section: 10.5.1.
  • MouseKeysAccel β€” control selection mask (which parameter): XkbMouseKeysAccelMask; relevant XkbControlsRec data fields: mk_delay, mk_interval, mk_time_to_max, mk_max_speed, mk_curve; boolean control enabled_ctrls bit: XkbMouseKeysAccelMask; section: 10.5.2.
  • Overlay1 β€” control selection mask (which parameter): β€”; relevant XkbControlsRec data fields: β€”; boolean control enabled_ctrls bit: XkbOverlay1Mask; section: 10.4.
  • Overlay2 β€” control selection mask (which parameter): β€”; relevant XkbControlsRec data fields: β€”; boolean control enabled_ctrls bit: XkbOverlay2Mask; section: 10.4.
  • PerKeyRepeat β€” control selection mask (which parameter): XkbPerKeyRepeatMask; relevant XkbControlsRec data fields: per_key_repeat; boolean control enabled_ctrls bit: Non-Boolean Control; section: 10.3.1.
  • RepeatKeys β€” control selection mask (which parameter): XkbRepeatKeysMask; relevant XkbControlsRec data fields: repeat_delay, repeat_interval; boolean control enabled_ctrls bit: XkbRepeatKeysMask; section: 10.3.
  • SlowKeys β€” control selection mask (which parameter): XkbSlowKeysMask; relevant XkbControlsRec data fields: slow_keys_delay; boolean control enabled_ctrls bit: XkbSlowKeysMask; section: 10.6.6.
  • StickyKeys β€” control selection mask (which parameter): XkbStickyKeysMask; relevant XkbControlsRec data fields: ax_options: XkbAX_TwoKeysMask, XkbAX_LatchToLockMask; boolean control enabled_ctrls bit: XkbStickyKeysMask; section: 10.6.8.

Table 2 shows the actual values for the individual mask bits used to select controls for modification and to enable and disable the control. Yep, same note again, because the page says it twice and we respect the lore: note 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 (no "ok" in column) are for controls that have no configurable attributes; and for controls that are not boolean controls and therefore cannot be enabled or disabled.

🌈 Table 2 Controls Mask Bits 🌈

  • 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: β€”; enabled_ctrls: ok; value: (1L<<9).
  • XkbOverlay1Mask β€” which or changed_ctrls: β€”; enabled_ctrls: ok; value: (1L<<10).
  • XkbOverlay2Mask β€” which or changed_ctrls: β€”; enabled_ctrls: ok; value: (1L<<11).
  • XkbIgnoreGroupLockMask β€” which or changed_ctrls: β€”; enabled_ctrls: ok; value: (1L<<12).
  • XkbGroupsWrapMask β€” which or changed_ctrls: ok; enabled_ctrls: β€”; value: (1L<<27).
  • XkbInternalModsMask β€” which or changed_ctrls: ok; enabled_ctrls: β€”; value: (1L<<28).
  • XkbIgnoreLockModsMask β€” which or changed_ctrls: ok; enabled_ctrls: β€”; value: (1L<<29).
  • XkbPerKeyRepeatMask β€” which or changed_ctrls: ok; enabled_ctrls: β€”; value: (1L<<30).
  • XkbControlsEnabledMask β€” which or changed_ctrls: ok; enabled_ctrls: β€”; value: (1L<<31).
  • XkbAccessXOptionsMask β€” which or changed_ctrls: ok; enabled_ctrls: ok; value: (XkbStickyKeysMask | XkbAccessXFeedbackMask).
  • XkbAllBooleanCtrlsMask β€” which or changed_ctrls: β€”; enabled_ctrls: ok; value: (0x00001FFF).
  • XkbAllControlsMask β€” which or changed_ctrls: ok; enabled_ctrls: β€”; value: (0xF8001FFF).

If you have an Xkb description with controls that have been modified and an XkbControlsChangesRec that describes the changes that have been made, the XkbChangeControls function provides a flexible method for updating the controls in a server to match those in the changed keyboard description. it’s giving β€œsend only the delta,” and we’re obsessed ✨

XkbChangeControls copies any controls fields specified by changes from the keyboard description controls structure, xkb->ctrls, to the server specified by dpy.

🧚 STRUCTURES 🧚

The XkbControlsChangesRec structure is defined as follows:

typedef struct _XkbControlsChanges {
    unsigned int  changed_ctrls;         /* bits indicating changed control data */
    unsigned int  enabled_ctrls_changes; /* bits indicating enabled/disabled controls */
    Bool          num_groups_changed;    /* True if number of keyboard groups changed */
} XkbControlsChangesRec,*XkbControlsChangesPtr;

⭐ SEE ALSO ⭐

the whole friend group:


cute sign-off, bestie: this page is from X Version 11, libX11 1.8.14 β€” and the footer doesn’t list a date, so no cap, I’m not inventing one. periodt πŸ’–βœ¨

πŸ“¦ where this page comes from