diff options
author | Mauro Carvalho Chehab <mchehab@infradead.org> | 2006-12-21 17:07:08 -0200 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2006-12-21 17:07:08 -0200 |
commit | d177273d8a164e788ef7646cc9d667224f80ff56 (patch) | |
tree | a45c1d51932f107d51d7b84f1583f6e92958baca /v4l2-apps/util/keytable.c | |
parent | 93c10c7c3e2cff0ef3917db7f52aab6dff90156e (diff) | |
download | mediapointer-dvb-s2-d177273d8a164e788ef7646cc9d667224f80ff56.tar.gz mediapointer-dvb-s2-d177273d8a164e788ef7646cc9d667224f80ff56.tar.bz2 |
Improved keycode printing
From: Mauro Carvalho Chehab <mchehab@infradead.org>
Now, it will print keycode name, if known.
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'v4l2-apps/util/keytable.c')
-rw-r--r-- | v4l2-apps/util/keytable.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/v4l2-apps/util/keytable.c b/v4l2-apps/util/keytable.c index 93aa8973c..3b922f12b 100644 --- a/v4l2-apps/util/keytable.c +++ b/v4l2-apps/util/keytable.c @@ -25,6 +25,15 @@ void prtcode (int *codes) { + struct parse_key *p; + + for (p=keynames;p->name!=NULL;p++) { + if (p->value == (unsigned)codes[1]) { + printf("scancode %d = %s (0x%02x)\n", codes[0], p->name, codes[1]); + return; + } + } + if (isprint (codes[1])) printf("scancode %d = '%c' (0x%02x)\n", codes[0], codes[1], codes[1]); else |