diff options
| author | Mauro Carvalho Chehab <mchehab@infradead.org> | 2006-12-21 16:42:14 -0200 |
|---|---|---|
| committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2006-12-21 16:42:14 -0200 |
| commit | c7ee85bf91ba65273bd377fb01df5227e18db67f (patch) | |
| tree | 7cb46780ccaf495c3ee84d549f2570685ff9f625 /v4l2-apps/util/Makefile | |
| parent | cd75b0ce0ae7333119fbe2b5739ac049d4cbfe43 (diff) | |
| download | mediapointer-dvb-s2-c7ee85bf91ba65273bd377fb01df5227e18db67f.tar.gz mediapointer-dvb-s2-c7ee85bf91ba65273bd377fb01df5227e18db67f.tar.bz2 | |
Add gen_keytables.pl to automatically generate IR keycodes and improved keytable
From: Mauro Carvalho Chehab <mchehab@infradead.org>
Keytable is now a 3 in 1 script:
calling with one argument, it reads keytable from a IR device
calling with two arguments, it writes a keytable at a IR device
calling with three arguments, it allows changing just one keymap
Of course, it is generic enough to work also with other event devices.
gen_keytables.pl will generate keyboard mappings, as defined at kernel module.
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'v4l2-apps/util/Makefile')
| -rw-r--r-- | v4l2-apps/util/Makefile | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/v4l2-apps/util/Makefile b/v4l2-apps/util/Makefile index 8c0277a6a..7d497c82b 100644 --- a/v4l2-apps/util/Makefile +++ b/v4l2-apps/util/Makefile @@ -20,3 +20,21 @@ qv4l2: install: include ../Make.rules + +parse.h: /usr/include/linux/input.h + @echo generating parse.h + @echo -en "struct parse_key {\n\tchar *name;\n\tunsigned int value;\n} " >parse.h + @echo -en "keynames[] = {\n" >>parse.h + + @more /usr/include/linux/input.h |perl -n \ + -e 'if (m/^\#define\s+(KEY_[^\s]+)\s+(0x[\d\w]+|[\d]+)/) ' \ + -e '{ printf "\t{\"%s\", %s},\n",$$1,$$2; }' \ + -e 'if (m/^\#define\s+(BTN_[^\s]+)\s+(0x[\d\w]+|[\d]+)/) ' \ + -e '{ printf "\t{\"%s\", %s},\n",$$1,$$2; }' \ + >> parse.h + @echo -en "\t{ NULL, 0}\n};\n" >>parse.h + +keytables: + ./gen_keytables.pl ../../v4l/ir-keymaps.c + +keytable: keytable.c parse.h keytables |
