diff options
| author | B. Watson <urchlay@slackware.uk> | 2025-05-11 00:53:08 -0400 |
|---|---|---|
| committer | B. Watson <urchlay@slackware.uk> | 2025-05-11 00:53:08 -0400 |
| commit | 627a209c100d563de7b3da65e5037d647c6f2ede (patch) | |
| tree | a877f58239056639cf4c6fe3e3ef170c273c9d37 /marsond.c | |
| parent | 010cedaaef3e1b2d465f52ed11394fbc3003ce50 (diff) | |
| download | marsond-627a209c100d563de7b3da65e5037d647c6f2ede.tar.gz | |
do not bind keys above 255, stops xinput from showing marsond as a pointer.
Diffstat (limited to 'marsond.c')
| -rw-r--r-- | marsond.c | 12 |
1 files changed, 11 insertions, 1 deletions
@@ -29,6 +29,12 @@ #define DEFAULT_USER "nobody" #define DEFAULT_GROUP "nobody" +/* uinput.h defines KEY_MAX for use with UI_SET_KEYBIT, but the + mouse buttons are included in the key constants, which makes + xinput think we're both a keyboard and a pointer. actual + keyboard keys stop before that. */ +#define LAST_KBD_KEY 255 + const char *self; int debugging = 0; /* -v */ @@ -309,7 +315,7 @@ int main(int argc, char **argv) { /* the other event types will never be sent by a keyboard. */ /* we want all possible keystrokes */ - for(i = 0; i < KEY_MAX; i++) { + for(i = 0; i <= LAST_KBD_KEY; i++) { if(ioctl(outfd, UI_SET_KEYBIT, i) >= 0) { /* we don't wanna be *that* verbose */ } else { @@ -421,4 +427,8 @@ event: type 0, code 0, value 0 Onlt the type 1 messages concern us, but we have to pass them all through. code 28 is KEY_ENTER, value is 1 for press, 0 for release. + +from uinput.h: +type 4 EV_MSC, code 4 MSC_SCAN. +type 0 EV_SYN, code 0 SYN_REPORT. */ |
