XkbAllocKeyboard(3) XKB FUNCTIONS XkbAllocKeyboard(3)

# [NAME](#NAME)

XkbAllocKeyboard - Creates a keyboard description from scratch

# [SYNOPSIS](#SYNOPSIS)

**XkbDescRec XkbAllocKeyboard** **(void);**

# [DESCRIPTION](#DESCRIPTION)

Applications seldom need to directly allocate a keyboard description; calling *XkbGetKeyboard* usually suffices. In the event you need to create a keyboard description from scratch, however, use *XkbAllocKeyboard* rather than directly calling *malloc.*

If *XkbAllocKeyboard* fails to allocate the keyboard description, it returns NULL. Otherwise, it returns a pointer to an empty keyboard description structure. The *device\_spec* field will have been initialized to XkbUseCoreKbd. You may then either fill in the structure components or use Xkb functions to obtain values for the structure components from a keyboard device.

# [SEE ALSO](#SEE_ALSO)

[**malloc**(3F)](/man/os/libx11/malloc.3F), [**XkbUseCoreKbd**(3)](/man/os/libx11/XkbUseCoreKbd.3), [**XkbGetKeyboard**(3)](/man/os/libx11/XkbGetKeyboard.3)

libX11 1.8.14 X Version 11

---

Document: XkbAllocKeyboard(3) from libx11 1.8.14-r0 (Chainguard OS)
Source: https://gitlab.freedesktop.org/xorg/lib/libx11.git
