From 6648029d5fc5525459a2ad6a161a71bdfe9f96e7 Mon Sep 17 00:00:00 2001 From: David Herrmann Date: Tue, 9 Oct 2012 13:56:30 +0200 Subject: [PATCH] test_input: fix using XKB directly We removed a lot of helpers from uterm-input because XKB is now a mandatory dependency. So use it directly from test_input to avoid all the uterm helpers. Signed-off-by: David Herrmann --- tests/test_input.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/tests/test_input.c b/tests/test_input.c index 5e32ba3..7a4e083 100644 --- a/tests/test_input.c +++ b/tests/test_input.c @@ -37,6 +37,7 @@ static void print_help(); #include #include #include +#include #include "eloop.h" #include "log.h" #include "uterm.h" @@ -84,19 +85,19 @@ static void print_modifiers(unsigned int mods) } static void input_arrived(struct uterm_input *input, - struct uterm_input_event *ev, - void *data) + struct uterm_input_event *ev, + void *data) { char s[32]; - uterm_input_keysym_to_string(input, ev->keysym, s, sizeof(s)); + xkb_keysym_get_name(ev->keysyms[0], s, sizeof(s)); printf("sym %s ", s); - if (ev->unicode != UTERM_INPUT_INVALID) { + if (ev->codepoints[0] != UTERM_INPUT_INVALID) { /* * Just a proof-of-concept hack. This works because glibc uses * UTF-32 (= UCS-4) as the internal wchar_t encoding. */ - printf("unicode %lc ", ev->unicode); + printf("unicode %lc ", ev->codepoints[0]); } print_modifiers(ev->mods); } @@ -114,7 +115,8 @@ static void monitor_event(struct uterm_monitor *mon, ret = uterm_input_new(&input, eloop, input_conf.xkb_layout, input_conf.xkb_variant, - input_conf.xkb_options); + input_conf.xkb_options, + 0, 0); if (ret) return; ret = uterm_input_register_cb(input, input_arrived, NULL);