XkbSASetPtrDfltValue(3)

πŸ’… XkbSASetPtrDfltValue β€” a lil' XKB function, from the XKB FUNCTIONS corner of yer man pages πŸŽ€

okay so bestie, this one's a tiny setter function and honestly it's giving "small but mighty." It's called XkbSASetPtrDfltValue, and what it does is set the valueXXX field of act from val ✨


🌸 SYNOPSIS 🌸

void XkbSASetPtrDfltValue (XkbAction act, int val);

short. sweet. iconic. no cap πŸ’–


πŸ¦‹ ARGUMENTS πŸ¦‹

  • act β€” the action where you're gonna set valueXXX, bestie
  • val β€” the value you're putting into valueXXX

πŸ’œ DESCRIPTION πŸ’œ

so, the actions tied to the XkbPtrDfltAction structure? They change the mk_dflt_btn attribute of the MouseKeys control. That's the whole vibe 🫢

but listen β€” if the MouseKeys control is not enabled, then KeyPress and KeyRelease events are treated as though the action is XkbSA_NoAction. Otherwise (and like, only otherwise), this action changes the mk_dflt_btn attribute of the MouseKeys control. important distinction, iykyk 😌

the type field of the XkbPtrDfltAction structure should always be XkbSA_SetPtrDflt. always always. no exceptions, periodt πŸ’…

the flags field is composed of the bitwise inclusive OR of the values shown in Table 1 β€” and rn there's only one value defined, so like, adorable amount of choice lol 🌈

⭐ Table 1: Pointer Default Flags ⭐

  • XkbSA_DfltBtnAbsolute β€” if set, the value field represents an absolute pointer button. Otherwise, the value field represents the amount to be added to the current default button πŸ’«

the affect field specifies what changes as a result of this action, and the only valid value for affect is XkbSA_AffectDfltBtn. that's it, that's the list πŸŽ€

and now the valueXXX field, the star of the show πŸ‘‘ β€” it's a signed character representing the new button value for the mk_dflt_btn attribute of the MouseKeys control. If XkbSA_DfltBtnAbsolute is set in flags, valueXXX specifies the button to be used. Otherwise, valueXXX specifies the amount to be added to the current default button. Either way? Illegal button choices get wrapped back around into range, so nothing goes rogue fr fr πŸ”₯

oh and also β€” Xkb provides macros to convert between the integer and signed character values in XkbPtrDfltAction structures. handy, right? 🧚


🌺 STRUCTURES 🌺

typedef struct _XkbPtrDfltAction {
    unsigned char    type;      /* XkbSA_SetPtrDflt */
    unsigned char    flags;     /* controls the pointer button number */
    unsigned char    affect;    /* XkbSA_AffectDfltBtn */
    char             valueXXX;  /* new default button member */
} XkbPtrDfltAction;

look at that little struct. four fields. immaculate. βœ…


πŸ’€ quick vibe check reminder: the type field is XkbSA_SetPtrDflt and affect is XkbSA_AffectDfltBtn β€” those are not suggestions, bestie.

and that's the whole page!! 🌸 mwah πŸ’– this was X Version 11, libX11 1.8.14, and the page itself is XkbSASetPtrDfltValue(3) β€” go forth and set those values, queen πŸ‘‘βœ¨πŸ“

πŸ“¦ where this page comes from