XkbSAScreen(3)

πŸ’… XkbSAScreen β€” XKB FUNCTIONS ✨

okay bestie, so this is a page from libX11's XKB functions, and it's genuinely a tiny little icon but the lore is real. Let's get into it πŸŽ€


🌸 NAME 🌸

XkbSAScreen β€” literally just hands you back the screenXXX field of act, converted to a signed int. that's the whole job. slay πŸ’…


✨ SYNOPSIS ✨

int XkbSAScreen (XkbSwitchScreenAction act);

🫢 ARGUMENTS 🫢

  • act β€” the action you wanna dig the screen out of. that's it, that's the arg πŸ’–

πŸ¦‹ DESCRIPTION πŸ¦‹

so, actions tied to the XkbSwitchScreen action structure are the ones that change the active screen on a multiscreen display. main character energy fr πŸ–₯️✨

the type field of the XkbSwitchScreenAction structure should always be XkbSA_SwitchScreen. no cap, always.

the flags field is composed of the bitwise inclusive OR of the masks in Table 1 down below πŸ‘‡

🌈 Table 1 β€” Switch Screen Action Flags 🌈

  • XkbSA_SwitchAbsolute β€” if it's set, the screenXXX field represents the index of the new screen. if it's not set, it represents an offset from the current screen to the new screen. iykyk πŸ’«
  • XkbSA_SwitchApplication β€” if it's not set, the action should switch to another screen on the same server. if it is set, it should switch to another X server or application that shares the same physical display. iconic behaviour tbh πŸ’…

the screenXXX field is a signed character value that represents either the relative or the absolute screen index β€” depends on the state of the XkbSA_SwitchAbsolute bit in the flags field. Xkb provides the following macros to convert between the integer and signed character value for screen numbers in XkbSwitchScreenAction structures. so convenient bestie 🧚

the XkbSAScreen macro returns the screenXXX field of act converted to a signed int. periodt. ⭐


πŸ’œ STRUCTURES πŸ’œ

typedef struct _XkbSwitchScreenAction {
    unsigned char    type;        /* XkbSA_SwitchScreen */
    unsigned char    flags;       /* controls screen switching */
    char             screenXXX;   /* screen number or delta */
} XkbSwitchScreenAction;

look at that little guy. three fields. living his best life. πŸ“


πŸ‘‘ NOTES πŸ‘‘

the XkbSwitchScreen action is optional. servers are free to ignore the action or any of its flags if they don't support the requested behavior. if the action is ignored, it behaves like XkbSA_NoAction. otherwise, key press and key release events do not generate an event. 😭 so yeah, don't count on it always doing the thing β€” it's giving "i'll do it if i feel like it" energy πŸ’€

and that's the whole page bestie, short & sweet 🌸 β€” brought to you by X Version 11, libX11 1.8.14, dated the way manpages do, with the page living under the name XkbSAScreen(3). mwah πŸ’‹πŸ«ΆπŸŽ€

πŸ“¦ where this page comes from