xcb_set_modifier_mapping(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_set_modifier_mapping β€” bestie's guide to rewriting the modifier map πŸ’–

okay so. this is a page from libxcb, manual section 3 (that's the library-functions girlies, iykyk). the function is xcb_set_modifier_mapping β€” and if you look at the original NAME line it's literally just the name and a dash with nothing after it. the manpage said "xcb_set_modifier_mapping -" and then dipped. iconic honestly. we move. ✨


🌸 SYNOPSIS 🌸

first up, the include. you're gonna need it:

#include <xcb/xproto.h>

πŸŽ€ Request function πŸŽ€

xcb_set_modifier_mapping_cookie_t
       xcb_set_modifier_mapping(xcb_connection_t *conn,
       uint8_t keycodes_per_modifier, const xcb_keycode_t *keycodes);

πŸ¦‹ Reply datastructure πŸ¦‹

typedef struct xcb_set_modifier_mapping_reply_t {
    uint8_t  response_type;
    uint8_t  status;
    uint16_t sequence;
    uint32_t length;
} xcb_set_modifier_mapping_reply_t;

πŸ’œ Reply function πŸ’œ

xcb_set_modifier_mapping_reply_t
       *xcb_set_modifier_mapping_reply(xcb_connection_t *conn,
       xcb_set_modifier_mapping_cookie_t cookie,
       xcb_generic_error_t **e);

✨ REQUEST ARGUMENTS ✨

  • conn β€” the XCB connection to X11. your lil hotline to the server, bestie 🫢
  • keycodes_per_modifier β€” TODO: NOT YET DOCUMENTED. yeah. the manpage itself said that. no cap. πŸ’€
  • keycodes β€” TODO: NOT YET DOCUMENTED. also that. the mystery continues πŸ™ˆ
fr fr the upstream docs left these two as TODO and i'm not about to make stuff up, so we're all just gonna sit with the not-knowing together. that's the vibe check.

🌈 REPLY FIELDS 🌈

  • response_type β€” the type of this reply. in this case it's XCB_SET_MODIFIER_MAPPING. this field is also hanging out in the xcb_generic_reply_t, so you can use it to tell replies apart from each other. main character field honestly πŸ‘‘
  • sequence β€” the sequence number of the last request processed by the X11 server. it's giving receipt 🧾
  • length β€” how long the reply is, in words. and heads up, a word is 4 bytes here. not 2. don't come for me πŸ’…
  • status β€” one of these values:
    • XCB_MAPPING_STATUS_SUCCESS β€” TODO: NOT YET DOCUMENTED. βœ…
    • XCB_MAPPING_STATUS_BUSY β€” TODO: NOT YET DOCUMENTED. ⏳
    • XCB_MAPPING_STATUS_FAILURE β€” TODO: NOT YET DOCUMENTED. πŸ’€
    • and then... TODO: NOT YET DOCUMENTED. yeah there's just a whole extra dangling TODO sitting there in the list with no name attached. we love a mystery queen πŸŽ€

πŸ’« DESCRIPTION πŸ’«

so like. the DESCRIPTION section in the original? completely empty. nothing. zero. a void. she said nothing and left πŸ¦‹


⭐ RETURN VALUE ⭐

it hands you back an xcb_set_modifier_mapping_cookie_t. and listen β€” errors have to be handled when you call the reply function xcb_set_modifier_mapping_reply. that's the whole deal.

but if you'd rather handle errors in the event loop instead? use xcb_set_modifier_mapping_unchecked. see xcb-requests(3) for details. go read it, i'll wait πŸ’œ


πŸ”₯ ERRORS πŸ”₯

this request does never generate any errors. none. zero. she's unproblematic, periodt ✨


πŸ“ SEE ALSO πŸ“

...nothing. the SEE ALSO section is empty. literally an empty room. no references. no friends listed. she's mysterious like that πŸ’…


🧚 AUTHOR 🧚

generated from xproto.xml. if you want corrections and improvements, hit up xcb@lists.freedesktop.org. they're the ones who can fix the TODOs, not me πŸ™ˆ


okay that's the whole page bestie!! and for the lil sign-off β€” this was X Version 11, from libxcb 1.17.0, and the page itself is xcb_set_modifier_mapping(3). love u, go forth and map those modifiers πŸ’–βœ¨πŸŽ€πŸ¦‹