triggerhappy icon indicating copy to clipboard operation
triggerhappy copied to clipboard

Highest valid KEY_* not accepted

Open Al- opened this issue 3 years ago • 0 comments

The highest valid event, i.e., KEY_MAX (= 0x2FF = 767), is not valid in triggerhappy. See thd --listevents. When I send KEY_MAX, then thd gets the event, but cannot recognize it:

berry ~/triggerhappy $ thd --dump /dev/input/event*
Unknown EV_KEY event id on /dev/input/event3 : 767 (value 1)
Unknown EV_KEY event id on /dev/input/event3 : 767 (value 0)

Possible patch:

diff --git a/Makefile b/Makefile
index d5823f1..92b953e 100644
--- a/Makefile
+++ b/Makefile
@@ -40,7 +40,7 @@ linux_input_defs_gen.inc:
        echo "#include <linux/input.h>" | $(CC) $(CPPFLAGS) -dM -E - > $@
 
 evtable_%.inc: linux_input_defs_gen.inc
-       awk '/^#define $*_/ && $$2 !~ /_(MIN_INTERESTING|MAX|CNT|VERSION)$$/ {print "EV_MAP("$$2"),"}' $< > $@
+       awk '/^#define $*_/ && $$2 !~ /_(MIN_INTERESTING|CNT|VERSION)$$/ {print "EV_MAP("$$2"),"}' $< > $@
 
 version.h: version.inc
        sed -r 's!(.*)!#define TH_VERSION "\1"!' $< > $@

Using the patched version, triggerhappy now recognizes KEY_MAX:

berry ~/triggerhappy $ ./thd --dump /dev/input/event*
EV_KEY	KEY_MAX	1	/dev/input/event3
# KEY_MAX	1	command

Al- avatar Nov 19 '22 08:11 Al-