---
name: "xcb_ungrab_key"
section: "3"
platform: "linux"
package: "libxcb"
version: "1.17.0-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/xcb_ungrab_key"
---

# xcb\_ungrab\_key(3)

release a key combination

## NAME

xcb\_ungrab\_key - release a key combination

## SYNOPSIS

**#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*);\

## REQUEST ARGUMENTS

- *conn*

  The XCB connection to X11.

- *key*

  The keycode of the specified key combination.

  Using the special value *XCB\_GRAB\_ANY* means releasing all possible key codes.

- *grab\_window*

  The window on which the grabbed key combination will be released.

- *modifiers*

  The modifiers of the specified key combination.

  Using the special value *XCB\_MOD\_MASK\_ANY* means releasing the key combination with every possible modifier combination.

## DESCRIPTION

Releases the key combination on *grab\_window* if you grabbed it using *xcb\_grab\_key* before.

## RETURN VALUE

Returns an *xcb\_void\_cookie\_t*. Errors (if any) have to be handled in the event loop.

If you want to handle errors directly with *xcb\_request\_check* instead, use *xcb\_ungrab\_key\_checked*. See **[xcb-requests(3)](/xcb-requests/3.md)** for details.

## ERRORS

- *xcb\_value\_error\_t*

  TODO: reasons?

- *xcb\_window\_error\_t*

  The specified *grab\_window* does not exist.

## SEE ALSO

[**xcb-requests**(3)](/xcb-requests/3.md), [**xcb\_grab\_key**(3)](/xcb_grab_key/3.md), [**xev**(1)](/xev/1.md)

## AUTHOR

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