diff options
author | Gerd Hoffmann <kraxel@redhat.com> | 2019-04-15 16:17:54 +0200 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2019-04-15 16:17:54 +0200 |
commit | 168c57b57f2fb4440943d4e672dee4ca34f060b8 (patch) | |
tree | dbd07001ebf4927a92a054fd18a613c57173cc4d /kbd.c | |
parent | 2c6f46ddb8c2b76558f5145850fd4d339a66ba3a (diff) | |
download | fbida-168c57b57f2fb4440943d4e672dee4ca34f060b8.tar.gz |
xkb: add xkb_init() to kbd.c
Diffstat (limited to 'kbd.c')
-rw-r--r-- | kbd.c | 18 |
1 files changed, 18 insertions, 0 deletions
@@ -54,6 +54,24 @@ void xkb_configure(void) fclose(fp); } +void xkb_init(void) +{ + xkb_ctx = xkb_context_new(XKB_CONTEXT_NO_FLAGS); + xkb_map = xkb_keymap_new_from_names(xkb_ctx, &xkb_layout, + XKB_KEYMAP_COMPILE_NO_FLAGS); + if (!xkb_map) { + xkb_layout.variant = NULL; + xkb_map = xkb_keymap_new_from_names(xkb_ctx, &xkb_layout, + XKB_KEYMAP_COMPILE_NO_FLAGS); + if (!xkb_map) { + xkb_layout.layout = "us"; + xkb_map = xkb_keymap_new_from_names(xkb_ctx, &xkb_layout, + XKB_KEYMAP_COMPILE_NO_FLAGS); + } + } + xkb_state = xkb_state_new(xkb_map); +} + /* ---------------------------------------------------------------------- */ struct termctrl { |