diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2021-05-17 17:56:14 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2021-05-18 23:14:44 +0000 |
commit | e72b30f424081678c862d84be116e7b2333923c7 (patch) | |
tree | c48f6bd046e57fbd7ced7860001bd93a283f0856 /tools | |
parent | 4c82cbd4d0bb6ca51c648256b357a8578450b7ac (diff) | |
download | libinput-e72b30f424081678c862d84be116e7b2333923c7.tar.gz |
tools/record: narrow down the obfuscation range
Let a few obvious modifiers through, including the F-key range. Especially
left control is useful to know if it's down.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/libinput-record.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/tools/libinput-record.c b/tools/libinput-record.c index 119aac23..1acd8ad8 100644 --- a/tools/libinput-record.c +++ b/tools/libinput-record.c @@ -156,9 +156,18 @@ obfuscate_keycode(struct input_event *ev) { switch (ev->type) { case EV_KEY: - if (ev->code >= KEY_ESC && ev->code < KEY_ZENKAKUHANKAKU) { - ev->code = KEY_A; - return true; + switch (ev->code) { + case KEY_ESC: + case KEY_TAB: + case KEY_ENTER: + case KEY_LEFTCTRL: + break; + default: + if ((ev->code > KEY_ESC && ev->code < KEY_CAPSLOCK) || + (ev->code >= KEY_KP7 && ev->code <= KEY_KPDOT)) { + ev->code = KEY_A; + return true; + } } break; case EV_MSC: |