summaryrefslogtreecommitdiff
path: root/password.c
diff options
context:
space:
mode:
authorDominique Martinet <asmadeus@codewreck.org>2018-06-08 21:58:01 +0900
committerDominique Martinet <asmadeus@codewreck.org>2018-06-08 22:42:15 +0900
commitd68ddd1532923fd904197742245370d95f4743e9 (patch)
treeb75976253008dfe0b0fc40cac8fa6834525a492b /password.c
parent515f03c94c687757056d6163137af81fcd3f80ee (diff)
swaylock: implement ^U to clear buffer
The whole state->xcb.modifiers thing didn't work at all (always 0) The xkb doc says "[xkb_state_serialize_mods] should not be used in regular clients; please use the xkb_state_mod_*_is_active API instead" so here it is
Diffstat (limited to 'password.c')
-rw-r--r--password.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/password.c b/password.c
index 6d49330..bb32286 100644
--- a/password.c
+++ b/password.c
@@ -139,6 +139,14 @@ void swaylock_handle_key(struct swaylock_state *state,
state->auth_state = AUTH_STATE_INPUT_NOP;
damage_state(state);
break;
+ case XKB_KEY_u:
+ if (state->xkb.control) {
+ clear_password_buffer(&state->password);
+ state->auth_state = AUTH_STATE_CLEAR;
+ damage_state(state);
+ break;
+ }
+ // fallthrough
default:
if (codepoint) {
append_ch(&state->password, codepoint);