xcb_get_keyboard_control(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_get_keyboard_control(3) β€” the XCB Requests girlies' guide

okay so bestie, welcome to the <xcb/xproto.h> corner of the X universe πŸ¦‹ this is the xcb_get_keyboard_control page, straight out of the XCB Requests section, and we're gonna read it together, no skimming, no cap.


✨ NAME ✨

xcb_get_keyboard_control β€” literally the request that asks the X server "hey girl, what's the keyboard doing rn?" πŸ’–

(the original name line is just the function name with a lil empty space after it β€” iconique, minimal, no notes πŸŽ€)


🌸 SYNOPSIS 🌸

First things first, you gotta pull in the header:

#include <xcb/xproto.h>

🫢 Request function

xcb_get_keyboard_control_cookie_t
       xcb_get_keyboard_control(xcb_connection_t *conn,
yes the signature just... ends there in the source. it's giving cliffhanger 😭 we keep it exactly as it is, periodt.

πŸ’– Reply datastructure

typedef struct xcb_get_keyboard_control_reply_t {
    uint8_t  response_type;
    uint8_t  global_auto_repeat;
    uint16_t sequence;
    uint32_t length;
    uint32_t led_mask;
    uint8_t  key_click_percent;
    uint8_t  bell_percent;
    uint16_t bell_pitch;
    uint16_t bell_duration;
    uint8_t  pad0[2];
    uint8_t  auto_repeats[32];
} xcb_get_keyboard_control_reply_t;

look at her. struct queen. pad0[2] is padding, she's just there for the alignment vibes ✨

🧚 Reply function

xcb_get_keyboard_control_reply_t
       *xcb_get_keyboard_control_reply(xcb_connection_t *conn,
       xcb_get_keyboard_control_cookie_t cookie,
       xcb_generic_error_t **e);

πŸ”₯ REQUEST ARGUMENTS πŸ”₯

  • conn β€” The XCB connection to X11. your lil pipeline to the server bestie, she's the whole main character here πŸ‘‘

πŸ‘‘ REPLY FIELDS πŸ‘‘

  • response_type β€” The type of this reply, in this case XCB_GET_KEYBOARD_CONTROL. This field is also present in the xcb_generic_reply_t and can be used to tell replies apart from each other. it's the name tag at the party πŸŽ€
  • sequence β€” The sequence number of the last request processed by the X11 server. lowkey your receipt number fr fr 🧾
  • length β€” The length of the reply, in words (a word is 4 bytes). not bytes, bestie β€” words. four bytes each. do not come for me πŸ’€
  • global_auto_repeat β€” One of the following values:
    • XCB_AUTO_REPEAT_MODE_OFF β€” TODO: NOT YET DOCUMENTED.
    • XCB_AUTO_REPEAT_MODE_ON β€” TODO: NOT YET DOCUMENTED.
    • XCB_AUTO_REPEAT_MODE_DEFAULT β€” TODO: NOT YET DOCUMENTED.
    • TODO: NOT YET DOCUMENTED.
okay so that last one is just... floating there. a stray TODO with no field name, no value, no nothing. she's mysterious, she's unlabeled, we are NOT deleting her πŸ™ˆ
  • led_mask β€” TODO: NOT YET DOCUMENTED.
  • key_click_percent β€” TODO: NOT YET DOCUMENTED.
  • bell_percent β€” TODO: NOT YET DOCUMENTED.
  • bell_pitch β€” TODO: NOT YET DOCUMENTED.
  • bell_duration β€” TODO: NOT YET DOCUMENTED.
  • auto_repeats β€” TODO: NOT YET DOCUMENTED.
not a single field got documented, and honestly? we respect the transparency. the TODO girlies are all just standing there, holding their little TODO: NOT YET DOCUMENTED. signs 🌈 we preserve them exactly, every single one, no edits, no guessing 🫢

πŸ’œ DESCRIPTION πŸ’œ

...the original section is literally empty. nothing. a blank space. a moment of silence. she said "no thoughts, head empty" and meant it 😭 and we are keeping it that way because the facts do not change, even when the facts are nothing.


⭐ RETURN VALUE ⭐

Returns an xcb_get_keyboard_control_cookie_t. Errors have to be handled when calling the reply function xcb_get_keyboard_control_reply.

If you want to handle errors in the event loop instead, use xcb_get_keyboard_control_unchecked. See xcb-requests(3) for details.

so it's a cookie πŸͺ you get the cookie first, then you come back for the actual reply. that's the whole bit. and if you'd rather catch your errors in the event loop, take the _unchecked route instead β€” xcb-requests(3) has the tea.

πŸ’€ ERRORS πŸ’€

This request does never generate any errors.

not a single one. zero. she's unbothered, moisturized, in her lane ✨

🌈 SEE ALSO 🌈

...the original lists nothing here. the SEE ALSO section is just a title and then silence. it's giving "no further reading, you're already perfect" πŸ’…


πŸŽ€ AUTHOR πŸŽ€

Generated from xproto.xml. Contact xcb@lists.freedesktop.org for corrections and improvements.

if something's off, hit up that mailing list bestie, they want the feedback fr fr πŸ’–

and that's the whole page!! every field, every TODO: NOT YET DOCUMENTED., every cookie, every word-length clarification, all preserved, all accounted for, no details harmed in the making of this rewrite 🫢

this whole thing lives in X Version 11, from libxcb 1.17.0 β€” that's the source and version energy at the bottom, and that's your cute lil sign-off from me to you πŸ’œ slay, stay connected, and always handle your errors. periodt. ✨