diff options
author | Drew DeVault <sir@cmpwn.com> | 2018-04-25 11:00:56 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-25 11:00:56 +0200 |
commit | c54097428a8f36e456d203d986d76702bd339066 (patch) | |
tree | ec248905f4c73d8f52c3e2c08ce26decbda2d704 /swaylock/password.c | |
parent | dfc26c664f8c1b007f15ff24a3055774af200c69 (diff) | |
parent | 75674295504af9118d2af3c8677d8e1e84e85e77 (diff) |
Merge branch 'master' into criteria-commands
Diffstat (limited to 'swaylock/password.c')
-rw-r--r-- | swaylock/password.c | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/swaylock/password.c b/swaylock/password.c index c8df3de8..1ad5cd81 100644 --- a/swaylock/password.c +++ b/swaylock/password.c @@ -105,11 +105,39 @@ void swaylock_handle_key(struct swaylock_state *state, state->auth_state = AUTH_STATE_INVALID; render_frames(state); break; + case XKB_KEY_Delete: case XKB_KEY_BackSpace: if (backspace(&state->password)) { state->auth_state = AUTH_STATE_BACKSPACE; - render_frames(state); + } else { + state->auth_state = AUTH_STATE_CLEAR; } + render_frames(state); + break; + case XKB_KEY_Escape: + clear_password_buffer(&state->password); + state->auth_state = AUTH_STATE_CLEAR; + render_frames(state); + break; + case XKB_KEY_Caps_Lock: + /* The state is getting active after this + * so we need to manually toggle it */ + state->xkb.caps_lock = !state->xkb.caps_lock; + state->auth_state = AUTH_STATE_INPUT_NOP; + render_frames(state); + break; + case XKB_KEY_Shift_L: + case XKB_KEY_Shift_R: + case XKB_KEY_Control_L: + case XKB_KEY_Control_R: + case XKB_KEY_Meta_L: + case XKB_KEY_Meta_R: + case XKB_KEY_Alt_L: + case XKB_KEY_Alt_R: + case XKB_KEY_Super_L: + case XKB_KEY_Super_R: + state->auth_state = AUTH_STATE_INPUT_NOP; + render_frames(state); break; default: if (codepoint) { |