summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilip Dexter <philip.dexter@gmail.com>2013-03-23 12:33:56 -0400
committerMichael Stapelberg <michael@stapelberg.de>2013-03-24 14:30:07 +0100
commit661344463aadbccf85120d056d30f486838c0dbd (patch)
treec545d33f54b82bff03d5b7a28dc791eafdbd6731
parentd8a1da69fbd91e71ef524a27b0f0752160b3aade (diff)
Add ctrl+u password reset
-rw-r--r--i3lock.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/i3lock.c b/i3lock.c
index 581ea10..c555ee8 100644
--- a/i3lock.c
+++ b/i3lock.c
@@ -239,8 +239,10 @@ static void handle_key_press(xcb_key_press_event_t *event) {
xkb_keysym_t ksym;
char buffer[128];
int n;
+ bool ctrl;
ksym = xkb_state_key_get_one_sym(xkb_state, event->detail);
+ ctrl = xkb_state_mod_name_is_active(xkb_state, "Control", XKB_STATE_MODS_DEPRESSED);
xkb_state_update_key(xkb_state, event->detail, XKB_KEY_DOWN);
/* The buffer will be null-terminated, so n >= 2 for 1 actual character. */
@@ -255,6 +257,9 @@ static void handle_key_press(xcb_key_press_event_t *event) {
unlock_state = STATE_KEY_PRESSED;
redraw_screen();
input_done();
+ case XKB_KEY_u:
+ if (!ctrl)
+ break;
case XKB_KEY_Escape:
input_position = 0;
clear_password_memory();