XkbSAActionSetCtrls(3)

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

✨ NAME ✨

XkbSAActionSetCtrls β€” bestie, this one sets the ctrls0 through ctrls3 fields of act from ctrls. That's it, that's the job πŸ’…

(oh also hi, you're reading the XKB FUNCTIONS corner of the libX11 manual, section 3, iykyk πŸŽ€)


🌸 SYNOPSIS 🌸

void XkbSAActionSetCtrls (XkbCtrlsAction act, unsigned int ctrls);

πŸ¦‹ ARGUMENTS πŸ¦‹

  • act β€” the action where we're gonna set ctrls0-ctrls3 🫢
  • ctrls β€” the value that goes into ctrls0-ctrls3 ✨

πŸ’– DESCRIPTION πŸ’–

So, actions that hang out with the XkbCtrlsAction structure? They change the state of the boolean controls. That's their whole thing, no cap.

The type field can be any one of the values in Table 1 πŸ‘‘

πŸ‘‘ Table 1: Controls Action Types

  • XkbSA_SetControls β€” a key press enables any boolean controls named in the ctrls fields that weren't already enabled when the key got pressed. A key release disables any controls that the key press enabled. This action can cause XkbControlsNotify events. Not me causing events fr 😭
  • XkbSA_LockControls β€” if the XkbSA_LockNoLock bit is not set in the flags field, a key press enables any controls named in the ctrls fields that weren't already enabled at the time of the key press. If the XkbSA_LockNoUnlock bit is not set in the flags field, a key release disables any controls named in the ctrls fields that weren't already disabled at the time of the key press. This action can cause XkbControlsNotify events too. Two event causers, we love to see it πŸ’…

The flags field is literally the bitwise inclusive OR of the masks in Table 2 🧚

🧚 Table 2: Control Action Flags

  • XkbSA_LockNoLock β€” if set, and the action type is XkbSA_LockControls, the server only disables controls. Locked out of locking, iconic honestly πŸ™ˆ
  • XkbSA_LockNoUnlock β€” if set, and the action type is XkbSA_LockControls, the server only enables controls.

The XkbSA_SetControls action implements a key that enables a boolean control when it's pressed and disables it when it's released. The XkbSA_LockControls action is what you use to implement a key that toggles the state of a boolean control every single time it's pressed and released. And the XkbSA_LockNoLock and XkbSA_LockNoUnlock flags let you modify that toggling behavior so it only unlocks, or only locks, the boolean control. Main character energy for real πŸ‘‘

The ctrls0, ctrls1, ctrls2, and ctrls3 fields represent the boolean controls in the enabled_ctrls field of the controls structure. Xkb macros, to convert between the two formats.

XkbSAActionSetCtrls sets the ctrls0 through ctrls3 fields of act from ctrls. Slay, that's the function πŸ’–


🌈 STRUCTURES 🌈

typedef struct _XkbCtrlsAction {
    unsigned char    type;    /* XkbSA_SetControls, XkbSA_LockControls */
    unsigned char    flags;   /* with type, controls enabling and disabling of controls */
    unsigned char    ctrls3;  /* ctrls0 through ctrls3 represent the boolean controls */
    unsigned char    ctrls2;  /* ctrls0 through ctrls3 represent the boolean controls */
    unsigned char    ctrls1;  /* ctrls0 through ctrls3 represent the boolean controls */
    unsigned char    ctrls0;  /* ctrls0 through ctrls3 represent the boolean controls */
} XkbCtrlsAction;

okay that's the whole page bestie 🫢 this was X Version 11, libX11 1.8.4, and the page itself is XkbSAActionSetCtrls(3) β€” go forth and set those ctrls fields, you absolute icon πŸ’…βœ¨πŸŽ€

πŸ“¦ where this page comes from