From e72b30f424081678c862d84be116e7b2333923c7 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Mon, 17 May 2021 17:56:14 +1000 Subject: [PATCH] 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 --- tools/libinput-record.c | 15 ++++++++++++--- 1 file 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: