XkbSASetScreen(3)

✨ XkbSASetScreen β€” the libX11 glow-up ✨

okay so bestie, welcome to XkbSASetScreen(3) from the XKB FUNCTIONS corner of the universe πŸ’… this one's a tiny little setter function and she's honestly iconic for it.


🌸 NAME 🌸

XkbSASetScreen β€” sets the screenXXX field of act from s. that's it. that's the whole job. slay πŸŽ€


πŸ¦‹ SYNOPSIS πŸ¦‹

void XkbSASetScreen (XkbSwitchScreenAction act, int s);

πŸ’– ARGUMENTS πŸ’–

  • act β€” the action where we're gonna set screenXXX, bestie. that's the target 🎯
  • s β€” the value we're stuffing into screenXXX, no cap ✨

πŸ‘‘ DESCRIPTION πŸ‘‘

okay so picture this: actions tied to the XkbSwitchScreen action structure are the ones that change the active screen on a multiscreen display. multitasking queen behavior, honestly πŸ–₯️✨

the type field of the XkbSwitchScreenAction structure should always be XkbSA_SwitchScreen. like, always always. that's her whole identity 🫢

the flags field? she's built from the bitwise inclusive OR of the masks in Table 1, which I'm serving to you right here πŸ‘‡

⭐ Table 1 β€” Switch Screen Action Flags ⭐

  • XkbSA_SwitchAbsolute β€” if this is set, the screenXXX field represents the index of the new screen. if it's not set, then it represents an offset from the current screen to the new screen. absolute queen vs. relative queen, pick your fighter πŸ’…
  • XkbSA_SwitchApplication β€” if this is 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. crossing over into someone else's server, we love a collab 🌈

and the screenXXX field itself? she's a signed character value that represents either the relative or absolute screen index, depending on the state of the XkbSA_SwitchAbsolute bit in the flags field. so like, the vibes of that one bit decide everything for her 😭

Xkb provides the following macros to convert between the integer and signed character value for screen numbers in XkbSwitchScreenAction structures. yes bestie, there are little conversion macros and they are doing the lord's work 🧚


πŸŽ€ STRUCTURES πŸŽ€

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

look at her. three fields. immaculate. no notes πŸ’œ


πŸ™ˆ NOTES πŸ™ˆ

heads up bestie, this action is optional. servers are totally free to ignore the action or any of its flags if they don't support the requested behavior. rude, but legal πŸ’€

and if the action is ignored, it behaves like XkbSA_NoAction. otherwise, key press and key release events do not generate an event. so like, don't go looking for an event that isn't coming, fr fr 😭


🌟 sign-off 🌟

this whole page is straight from X Version 11, libX11 1.8.14, and it's the XkbSASetScreen(3) page β€” go forth and set that screenXXX field, bestie. you're gonna ate πŸ«ΆπŸ’–βœ¨

πŸ“¦ where this page comes from