The snippets are not complete, and some support code is omitted. You
can find complete and more complex examples in the source directory:
-1. test/interactive-evdev.c contains an interactive evdev client.
+1. tools/interactive-evdev.c contains an interactive evdev client.
-2. test/interactive-x11.c contains an interactive X11 client.
+2. tools/interactive-x11.c contains an interactive X11 client.
+
+3. tools/interactive-wayland.c contains an interactive Wayland client.
Also, the library contains many more functions for examining and using
the library context, the keymap and the keyboard state. See the
~~~{.c}
#include <xkbcommon/xkbcommon.h>
- struct xkb_context ctx;
+ struct xkb_context *ctx;
ctx = xkb_context_new(XKB_CONTEXT_NO_FLAGS);
if (!ctx) <error>
~~~{.c}
/* From the wl_keyboard::keymap event. */
const char *keymap_string = <...>;
+ struct xkb_keymap *keymap;
keymap = xkb_keymap_new_from_string(ctx, keymap_string,
XKB_KEYMAP_FORMAT_TEXT_V1,