diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2017-02-13 11:07:03 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2017-02-14 07:53:22 +1000 |
commit | 8c1aa1de006bbb3321c29bf4634090da39f5fa37 (patch) | |
tree | e1f1c4fb62bccf3399df23e9e966072a4119a3e6 /tools/shared.c | |
parent | b23318492e76e39b85fe99ba9a6408b1521b55a6 (diff) |
tools: hide key codes by default
libinput-debug-events prints keycodes as they come in. This makes it dangerous
to be run by users (especially in the background) because it will leak
sensitive information as it is typed. Obfuscate the base set of keycodes
by default, require a --show-keycodes switch to show it.
The few times we actually need the keycodes, we can run the switch in the
debugging tool.
This does not affect keys outside of the main block on the keyboard (F-keys,
multimedia keys).
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Diffstat (limited to 'tools/shared.c')
-rw-r--r-- | tools/shared.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/tools/shared.c b/tools/shared.c index 05fb118..1019184 100644 --- a/tools/shared.c +++ b/tools/shared.c @@ -62,6 +62,7 @@ enum options { OPT_SCROLL_BUTTON, OPT_SPEED, OPT_PROFILE, + OPT_SHOW_KEYCODES, }; LIBINPUT_ATTRIBUTE_PRINTF(3, 0) @@ -103,6 +104,7 @@ tools_usage(void) "--set-profile=[adaptive|flat].... set pointer acceleration profile\n" "--set-speed=<value>.... set pointer acceleration speed (allowed range [-1, 1]) \n" "--set-tap-map=[lrm|lmr] ... set button mapping for tapping\n" + "--show-keycodes.... show all key codes while typing\n" "\n" "These options apply to all applicable devices, if a feature\n" "is not explicitly specified it is left at each device's default.\n" @@ -137,6 +139,7 @@ tools_init_context(struct tools_context *context) options->seat = "seat0"; options->speed = 0.0; options->profile = LIBINPUT_CONFIG_ACCEL_PROFILE_NONE; + options->show_keycodes = false; } int @@ -173,6 +176,7 @@ tools_parse_args(int argc, char **argv, struct tools_context *context) { "set-profile", 1, 0, OPT_PROFILE }, { "set-tap-map", 1, 0, OPT_TAP_MAP }, { "set-speed", 1, 0, OPT_SPEED }, + { "show-keycodes", 0, 0, OPT_SHOW_KEYCODES }, { 0, 0, 0, 0} }; @@ -337,6 +341,9 @@ tools_parse_args(int argc, char **argv, struct tools_context *context) return 1; } break; + case OPT_SHOW_KEYCODES: + options->show_keycodes = true; + break; default: tools_usage(); return 1; |