Skip to content

Highest valid KEY_* not accepted #34

Description

@Al-

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions