From: ian Date: Thu, 5 Jun 2008 23:07:42 +0000 (+0000) Subject: evdev-manip compiles and mostly works X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ijackson/git?a=commitdiff_plain;h=b1b89b013b68467d84b2e4fcdd469c1821191d09;p=trains.git evdev-manip compiles and mostly works --- diff --git a/hostside/evdev-manip.c b/hostside/evdev-manip.c index 72ae4e5..86aab07 100644 --- a/hostside/evdev-manip.c +++ b/hostside/evdev-manip.c @@ -31,16 +31,16 @@ static Device *devices; static Mode mode; static int grab; -static void pr_hexdec(unsigned long value) { printf("%#lx %ld",value,value); } +static void pr_hex(unsigned long value) { printf("%#lx",value); } #define PR_TABLE_STR(tab, val) (pr_table_str(iesis_##tab, iesin_##tab, (val))) static void pr_table_str(const InputEventStringInfo *strings, int nstrings, unsigned long value) { const InputEventStringInfo *string; - if (value > nstrings) { pr_hexdec(value); return; } + if (value > nstrings) { pr_hex(value); return; } string= &strings[value]; - if (!string->prefix) { pr_hexdec(value); return; } - printf("%s %s", string->prefix, string->main); + if (!string->prefix) { pr_hex(value); return; } + printf("%s_%s", string->prefix, string->main); } static void pr_time(struct timeval tv) { @@ -64,7 +64,7 @@ static void dump_event(Device *d, const struct input_event *ie) { if (!t->strings) t= 0; } if (t) pr_table_str(t->strings, t->nstrings, ie->code); - else pr_hexdec(ie->code); + else pr_hex(ie->code); printf(" "); switch (ie->type) {