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

# XkbTranslateKeySym(3)

Find the string and symbol associated with a keysym for a given keyboard state

## NAME

XkbTranslateKeySym - Find the string and symbol associated with a keysym for a given keyboard state

## SYNOPSIS

**int XkbTranslateKeySym** **(Display \****dpy***,** **KeySym \****sym\_inout***,** **unsigned int** *mods***,** **char \****buf***,** **int** *nbytes***,** **int \****extra\_rtrn***);**

## ARGUMENTS

- *dpy*

  connection to X server

- *sym\_inout*

  symbol to be translated; result of translation

- *mods*

  modifiers to apply to sym\_inout

- *buf*

  buffer into which returned string is written

- *nbytes*

  size of buffer in bytes

- *extra\_rtrn*

  number of bytes overflow

## DESCRIPTION

*XkbTranslateKeySym* applies the transformations specified in *mods* to the symbol specified by *sym\_inout.* It returns in *buf* the string, if any, associated with the keysym for the current locale. If the transformations in *mods* changes the keysym, *sym\_inout* is updated accordingly. If the string returned is larger than *nbytes,* a count of bytes that does not fit into the buffer is returned in *extra\_rtrn. XkbTranslateKeySym* returns the number of bytes it placed into *buf.*

## RETURN VALUES

- buf

  Returns the string, if any, associated with the keysym for the current locale.
