xcb_ungrab_key(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_ungrab_key β€” release a key combination πŸ’–

okay so bestie, welcome to the xcb_ungrab_key(3) page, part of the XCB Requests crew πŸŽ€ this one is short and sweet and honestly kind of a palate cleanser after the chaos that is grabbing. let's get into it πŸ’…


✨ SYNOPSIS ✨

first things first, you gotta pull in the header:

#include <xcb/xproto.h>

πŸ¦‹ Request function

xcb_void_cookie_t xcb_ungrab_key(xcb_connection_t *conn,
       xcb_keycode_t key, xcb_window_t grab_window, uint16_t modifiers);

that's it, that's the whole vibe. one function, four args, zero drama 🌸


🌈 REQUEST ARGUMENTS 🌈

  • conn β€” the XCB connection to X11. your lil lifeline to the server, the group chat you're posting in πŸ’–
  • key β€” the keycode of the specified key combination. lowkey important detail: if you use the special value XCB_GRAB_ANY, you're releasing all possible key codes at once. like, every single one. icon behavior honestly πŸ‘‘
  • grab_window β€” the window on which the grabbed key combination will be released. this is the spot where the un-grabbing happens πŸͺŸβœ¨
  • modifiers β€” the modifiers of the specified key combination. and here's the tea: using the special value XCB_MOD_MASK_ANY means you're releasing the key combination with every possible modifier combination. Ctrl? Shift? Alt? all of them, bestie. the whole squad πŸ’…

πŸŽ€ DESCRIPTION πŸŽ€

so basically: xcb_ungrab_key releases the key combination on grab_window if you grabbed it using xcb_grab_key before. that's the whole thing. you grabbed it, now you're letting it go. it's giving closure πŸ¦‹


πŸ’€ RETURN VALUE πŸ’€

it returns an xcb_void_cookie_t. no cap. and because it's void, any errors (if there are any) have to be handled in the event loop β€” you don't get them handed to you directly, you gotta go looking πŸ‘€

if you want to handle errors directly with xcb_request_check instead, use xcb_ungrab_key_checked. same energy, just more upfront about its problems πŸ™ˆ see xcb-requests(3) for the details.


😭 ERRORS 😭

  • xcb_value_error_t β€” TODO: reasons? yeah bestie, the docs themselves said "idk" on this one πŸ’€ we're all just vibing
  • xcb_window_error_t β€” the specified grab_window does not exist. it's not there. it ghosted you πŸ‘»

πŸ‘‘ SEE ALSO πŸ‘‘


πŸ’œ AUTHOR πŸ’œ

generated from xproto.xml. got corrections or improvements? contact xcb@lists.freedesktop.org β€” they're literally taking submissions, go off 🫢


and that's the page, bestie ✨ this was xcb_ungrab_key(3) from X Version 11, brought to you by libxcb 1.17.0. thanks for reading, now go release that key combo, you absolute main character πŸŒŸπŸŽ€πŸ¦‹