aboutsummaryrefslogtreecommitdiffstats
path: root/debian/patches/02_av7110_loadkeys-BTN.dpatch
diff options
context:
space:
mode:
Diffstat (limited to 'debian/patches/02_av7110_loadkeys-BTN.dpatch')
-rw-r--r--debian/patches/02_av7110_loadkeys-BTN.dpatch105
1 files changed, 105 insertions, 0 deletions
diff --git a/debian/patches/02_av7110_loadkeys-BTN.dpatch b/debian/patches/02_av7110_loadkeys-BTN.dpatch
new file mode 100644
index 0000000..8f49275
--- /dev/null
+++ b/debian/patches/02_av7110_loadkeys-BTN.dpatch
@@ -0,0 +1,105 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 02_av7110_loadkeys-BTN.dpatch by Thomas Schmidt <thomas.schmidt@in.stud.tu-ilmenau.de>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: patch to allow BTN_* as input-keynames (closes: #273733)
+
+@DPATCH@
+diff -urNad linuxtv-dvb-apps/util/av7110_loadkeys/av7110_loadkeys.c /tmp/dpep.6x7trg/linuxtv-dvb-apps/util/av7110_loadkeys/av7110_loadkeys.c
+--- linuxtv-dvb-apps/util/av7110_loadkeys/av7110_loadkeys.c 2004-05-14 12:32:12.000000000 +0200
++++ /tmp/dpep.6x7trg/linuxtv-dvb-apps/util/av7110_loadkeys/av7110_loadkeys.c 2004-09-28 15:49:18.000000000 +0200
+@@ -35,7 +35,8 @@
+ {
+ int cmp, index;
+ int l = 1;
+- int r = sizeof (key_name) / sizeof (key_name[0]);
++ const struct input_key_name *kn;
++ int r;
+
+ if (limit < 5)
+ return -1;
+@@ -46,7 +47,18 @@
+ limit--;
+ }
+
+- if (pos [0] != 'K' || pos[1] != 'E' || pos[2] != 'Y' || pos[3] != '_')
++ if (pos[3] != '_')
++ return -2;
++
++ if (pos[0] == 'K' && pos[1] == 'E' && pos[2] == 'Y') {
++ kn = key_name;
++ r = sizeof (key_name) / sizeof (key_name[0]);
++ }
++ else if (pos[0] == 'B' && pos[1] == 'T' && pos[2] == 'N') {
++ kn = btn_name;
++ r = sizeof (btn_name) / sizeof (btn_name[0]);
++ }
++ else
+ return -2;
+
+ (*nend) += 4;
+@@ -58,19 +70,19 @@
+
+ index = (l + r) / 2;
+
+- len0 = strlen(key_name[index-1].name);
++ len0 = strlen(kn[index-1].name);
+
+ while (len1 < limit && isgraph(pos[len1]))
+ len1++;
+
+- cmp = strncmp (key_name[index-1].name, pos,
+- strlen(key_name[index-1].name));
++ cmp = strncmp (kn[index-1].name, pos,
++ strlen(kn[index-1].name));
+
+ if (len0 < len1 && cmp == 0)
+ cmp = -1;
+
+ if (cmp == 0) {
+- *nend = pos + strlen (key_name[index-1].name);
++ *nend = pos + strlen (kn[index-1].name);
+
+ if (**nend != '\n' &&
+ **nend != '\t' &&
+@@ -78,7 +90,7 @@
+ *nend != pos)
+ return -3;
+
+- return key_name[index-1].key;
++ return kn[index-1].key;
+ }
+
+ if (cmp < 0)
+diff -urNad linuxtv-dvb-apps/util/av7110_loadkeys/Makefile /tmp/dpep.6x7trg/linuxtv-dvb-apps/util/av7110_loadkeys/Makefile
+--- linuxtv-dvb-apps/util/av7110_loadkeys/Makefile 2004-05-14 12:32:12.000000000 +0200
++++ /tmp/dpep.6x7trg/linuxtv-dvb-apps/util/av7110_loadkeys/Makefile 2004-09-28 15:49:18.000000000 +0200
+@@ -12,7 +12,7 @@
+ evtest.o: evtest.c input_keynames.h
+
+
+-input_keynames.h: /usr/include/linux/input.h input_fake.h
++input_keynames.h: /usr/include/linux/input.h input_fake.h Makefile
+ @echo 'generate $@...'
+ @echo '#ifndef __INPUT_KEYNAMES_H__' > $@
+ @echo '#define __INPUT_KEYNAMES_H__' >> $@
+@@ -32,8 +32,17 @@
+ @echo '' >> $@
+ @echo 'static struct input_key_name key_name [] = {' >> $@
+ @for x in `cat /usr/include/linux/input.h input_fake.h | \
+- grep KEY_ | grep "#define" | grep -v KEY_MAX | \
+- cut -f 1 | cut -f 2 -d ' ' | sort | uniq` ; do \
++ 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 }," >> $@ \
++ ; \
++ done
++ @echo '};' >> $@
++ @echo '' >> $@
++ @echo 'static struct input_key_name btn_name [] = {' >> $@
++ @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 }," >> $@ \
+ ; \
+ done