summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorDavid Herrmann <dh.herrmann@googlemail.com>2012-10-09 13:56:30 +0200
committerDavid Herrmann <dh.herrmann@googlemail.com>2012-10-09 13:56:30 +0200
commit6648029d5fc5525459a2ad6a161a71bdfe9f96e7 (patch)
treef9a3ce83f6bf4bbc668bbda6125b0b9b933e2d22 /tests
parent1709c64ee644148501fb35b2d04592cd354f85e2 (diff)
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 <dh.herrmann@googlemail.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/test_input.c14
1 files 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 <sys/signalfd.h>
#include <unistd.h>
#include <X11/keysym.h>
+#include <xkbcommon/xkbcommon.h>
#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);