From c78ce0770a8c75d63853c6c85f789b68f56ee3ed Mon Sep 17 00:00:00 2001 From: Dominique Martinet Date: Fri, 8 Jun 2018 21:58:01 +0900 Subject: 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 --- swaylock/password.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'swaylock/password.c') diff --git a/swaylock/password.c b/swaylock/password.c index 6d493309..bb32286e 100644 --- a/swaylock/password.c +++ b/swaylock/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); -- cgit v1.2.3