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>
This commit is contained in:
David Herrmann 2012-05-27 16:41:19 +02:00
parent ff7c065692
commit 51bfe9d107

View File

@ -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.