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

# XkbLookupKeySym(3)

Find the symbol associated with a key for a particular state

## NAME

XkbLookupKeySym - Find the symbol associated with a key for a particular state

## SYNOPSIS

**Bool XkbLookupKeySym** **(Display \****dpy***,** **KeyCode** *key***,** **unsigned int** *state***,** **unsigned int \****mods\_rtrn***,** **KeySym \****sym\_rtrn***);**

## ARGUMENTS

- *dpy*

  connection to X server

- *key*

  key for which symbols are to be found

- *state*

  state for which symbol should be found

- *mods\_rtrn*

  backfilled with consumed modifiers

- *sym\_rtrn*

  backfilled with symbol associated with key + state

## DESCRIPTION

*XkbLookupKeySym* is the equivalent of the core *XLookupKeySym* function. For the core keyboard, given a keycode *key* and an Xkb state *state, XkbLookupKeySym* returns the symbol associated with the key in *sym\_rtrn* and the list of modifiers that should still be applied in *mods\_rtrn.* The *state* parameter is the state from a KeyPress or KeyRelease event. *XkbLookupKeySym* returns True if it succeeds.

## SEE ALSO

**XLookupKeySym**(3)
