xcb_xkb_get_state(3)

πŸ“¦
version 1.17.0 Β· 4 versions
, in alpine 3.22, alpine 3.23, alpine 3.24, arch rolling, centos-stream 10, debian trixie, fedora 43, fedora 44, nixpkgs unstable, opensuse-leap 16.0, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ’… xcb_xkb_get_state β€” it's giving "XKB state, but make it a request"

okay so bestie, welcome to xcb_xkb_get_state(3) from the XCB Requests corner of the manual. grab a boba, this one's short and sweet πŸ§‹βœ¨


🌸 NAME 🌸

xcb_xkb_get_state β€” that's literally it, the NAME section left the description blank, and honestly? iconic of it. no cap, that's the whole name entry. πŸ’€


✨ SYNOPSIS ✨

first up, you gotta pull in the header or nothing works, bestie:

#include <xcb/xkb.h>

πŸ¦‹ Request function

xcb_xkb_get_state_cookie_t xcb_xkb_get_state(xcb_connection_t *conn,
       xcb_xkb_device_spec_t deviceSpec);

πŸŽ€ Reply datastructure

this is the lil struct you're gonna be looking at, and yes every field is here, i'm not skipping a single one, that's a promise 🫢:

typedef struct xcb_xkb_get_state_reply_t {
    uint8_t  response_type;
    uint8_t  deviceID;
    uint16_t sequence;
    uint32_t length;
    uint8_t  mods;
    uint8_t  baseMods;
    uint8_t  latchedMods;
    uint8_t  lockedMods;
    uint8_t  group;
    uint8_t  lockedGroup;
    int16_t  baseGroup;
    int16_t  latchedGroup;
    uint8_t  compatState;
    uint8_t  grabMods;
    uint8_t  compatGrabMods;
    uint8_t  lookupMods;
    uint8_t  compatLookupMods;
    uint8_t  pad0;
    uint16_t ptrBtnState;
    uint8_t  pad1[6];
} xcb_xkb_get_state_reply_t;

⭐ Reply function

xcb_xkb_get_state_reply_t
       *xcb_xkb_get_state_reply(xcb_connection_t *conn,
       xcb_xkb_get_state_cookie_t cookie, xcb_generic_error_t **e);

πŸ”₯ REQUEST ARGUMENTS πŸ”₯

  • conn β€” the XCB connection to X11, obviously. your lil hotline to the server πŸ“ž
  • deviceSpec β€” TODO: NOT YET DOCUMENTED. bestie i'm so serious, that's literally what the page says. it's giving "mystery", it's giving "the docs said no" 😭

πŸ’– REPLY FIELDS πŸ’–

  • response_type β€” the type of this reply, and in this case it's XCB_XKB_GET_STATE. this field is ALSO chillin' inside xcb_generic_reply_t, so you can use it to tell your replies apart from each other like a little name tag 🏷️
  • sequence β€” the sequence number of the last request the X11 server processed. it's the "wait, where are we in the timeline" number ⏳
  • length β€” how long the reply is, in words. and reminder, a word is 4 bytes. math is math πŸ’…
  • deviceID β€” TODO: NOT YET DOCUMENTED.
  • mods β€” TODO: NOT YET DOCUMENTED.
  • baseMods β€” TODO: NOT YET DOCUMENTED.
  • latchedMods β€” TODO: NOT YET DOCUMENTED.
  • lockedMods β€” TODO: NOT YET DOCUMENTED.
  • group β€” TODO: NOT YET DOCUMENTED.
  • lockedGroup β€” TODO: NOT YET DOCUMENTED.
  • baseGroup β€” TODO: NOT YET DOCUMENTED.
  • latchedGroup β€” TODO: NOT YET DOCUMENTED.
  • compatState β€” TODO: NOT YET DOCUMENTED.
  • grabMods β€” TODO: NOT YET DOCUMENTED.
  • compatGrabMods β€” TODO: NOT YET DOCUMENTED.
  • lookupMods β€” TODO: NOT YET DOCUMENTED.
  • compatLookupMods β€” TODO: NOT YET DOCUMENTED.
  • ptrBtnState β€” TODO: NOT YET DOCUMENTED.
lowkey half this struct is a mystery box and i'm just the messenger 🎁 the page said "not yet documented" and i am NOT about to invent lore. no cap.

🌈 DESCRIPTION 🌈

okay so, genuinely, the DESCRIPTION section of this page is... empty. nothing. a void. the silence is loud, bestie πŸ˜­πŸ•³οΈ that's not me skipping it, that's just literally what's there.


πŸ‘‘ RETURN VALUE πŸ‘‘

you get back an xcb_xkb_get_state_cookie_t. and here's the tea: errors have to be handled when you call the reply function, aka xcb_xkb_get_state_reply ⚠️

but if you'd rather handle your errors inside the event loop instead? use xcb_xkb_get_state_unchecked. see xcb-requests(3) for the deets 🫢


πŸ’€ ERRORS πŸ’€

this request never generates any errors. not one. zero. it's the chillest request in the whole group chat, it would never start drama 🌸


πŸŽ€ SEE ALSO πŸŽ€

bestie the SEE ALSO section is empty too. nothing to link, nothing to peek at. we move. πŸ’…

🧚 AUTHOR 🧚

generated from xkb.xml. contact xcb@lists.freedesktop.org for corrections and improvements πŸ“§


and that's the whole page, periodt πŸ’œ this lil doc came to you from X Version 11, libxcb 1.17.0, and yes it's literally titled xcb_xkb_get_state(3) β€” slay, go forth, and may all your replies be documented someday πŸ™ˆβœ¨