summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorDavid Herrmann <dh.herrmann@googlemail.com>2012-05-27 16:41:19 +0200
committerDavid Herrmann <dh.herrmann@googlemail.com>2012-05-27 16:41:19 +0200
commit51bfe9d107ff11ea00e3c6a1157cfa471294fd5f (patch)
treed2218108f1fcf2a440cec319a1d498a1f77459b8 /tests
parentff7c0656922dccf0bb540ed14e71027f7d939f9b (diff)
test_input: always print keysym
Print keysym even if we have a UCS4 representation. This makes debugging keyboard issues much easier. Also increase buffer size to 32 as there are many symbols longer than 16 characters. Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/test_input.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/tests/test_input.c b/tests/test_input.c
index 180635c..84083bb 100644
--- a/tests/test_input.c
+++ b/tests/test_input.c
@@ -87,12 +87,11 @@ static void input_arrived(struct uterm_input *input,
struct uterm_input_event *ev,
void *data)
{
- char s[16];
+ char s[32];
- if (ev->unicode == UTERM_INPUT_INVALID) {
- kbd_keysym_to_string(ev->keysym, s, sizeof(s));
- printf("sym %s ", s);
- } else {
+ kbd_keysym_to_string(ev->keysym, s, sizeof(s));
+ printf("sym %s ", s);
+ if (ev->unicode != UTERM_INPUT_INVALID) {
/*
* Just a proof-of-concept hack. This works because glibc uses
* UTF-32 (= UCS-4) as the internal wchar_t encoding.