diff options
author | David Herrmann <dh.herrmann@googlemail.com> | 2012-05-27 16:41:19 +0200 |
---|---|---|
committer | David Herrmann <dh.herrmann@googlemail.com> | 2012-05-27 16:41:19 +0200 |
commit | 51bfe9d107ff11ea00e3c6a1157cfa471294fd5f (patch) | |
tree | d2218108f1fcf2a440cec319a1d498a1f77459b8 /tests | |
parent | ff7c0656922dccf0bb540ed14e71027f7d939f9b (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.c | 9 |
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. |