aboutsummaryrefslogtreecommitdiffstats
path: root/util/av7110_loadkeys/generate-keynames.sh
diff options
context:
space:
mode:
authorMark Purcell <msp@debian.org>2008-06-22 11:00:40 +1000
committeretobi <git@e-tobi.net>2013-09-03 09:48:42 +0200
commit891c51ff368ed700dec6025eeb47ce4d96f76418 (patch)
tree3729664829e4faa691d403274f38eb10890b533c /util/av7110_loadkeys/generate-keynames.sh
parent1c6e1f28f54ec2606c23936c1d8689f2be55a86c (diff)
parentab959d7b4194715870128e616b8e29d4a101e488 (diff)
downloadlinux-dvb-apps-891c51ff368ed700dec6025eeb47ce4d96f76418.tar.gz
Imported Debian patch 1.1.1+rev1207-1debian/1.1.1+rev1207-1
Diffstat (limited to '')
-rw-r--r--util/av7110_loadkeys/generate-keynames.sh37
1 files changed, 37 insertions, 0 deletions
diff --git a/util/av7110_loadkeys/generate-keynames.sh b/util/av7110_loadkeys/generate-keynames.sh
new file mode 100644
index 0000000..49d2b71
--- /dev/null
+++ b/util/av7110_loadkeys/generate-keynames.sh
@@ -0,0 +1,37 @@
+# Makefile helper for linuxtv.org dvb-apps/util/av7110_loadkeys
+
+echo "generate $1..."
+echo "#ifndef INPUT_KEYNAMES_H" > $1
+echo "#define INPUT_KEYNAMES_H" >> $1
+echo >> $1
+echo "#include <linux/input.h>" >> $1
+echo >> $1
+echo "#if !defined(KEY_OK)" >> $1
+echo "#include \"input_fake.h\"" >> $1
+echo "#endif" >> $1
+echo >> $1
+echo >> $1
+echo "struct input_key_name {" >> $1
+echo " const char *name;" >> $1
+echo " int key;" >> $1
+echo "};" >> $1
+echo >> $1
+echo >> $1
+echo "static struct input_key_name key_name [] = {" >> $1
+for x in $(cat /usr/include/linux/input.h input_fake.h | \
+ egrep "#define[ \t]+KEY_" | grep -v KEY_MAX | \
+ cut -f 1 | cut -f 2 -d " " | sort -u) ; do
+ echo " { \"$(echo $x | cut -b 5-)\", $x }," >> $1
+done
+echo "};" >> $1
+echo >> $1
+echo "static struct input_key_name btn_name [] = {" >> $1
+for x in $(cat /usr/include/linux/input.h input_fake.h | \
+ egrep "#define[ \t]+BTN_" | \
+ cut -f 1 | cut -f 2 -d " " | sort -u) ; do
+ echo " { \"$(echo $x | cut -b 5-)\", $x }," >> $1
+done
+echo "};" >> $1
+echo >> $1
+echo "#endif /* INPUT_KEYNAMES_H */" >> $1
+echo >> $1