]> git.sur5r.net Git - i3/i3lock/commitdiff
Allow CTRL+J as enter and CTRL+H as backspace (#72)
authorKarl Tarbe <karulont@gmail.com>
Sat, 30 Apr 2016 10:25:51 +0000 (13:25 +0300)
committerMichael Stapelberg <stapelberg@users.noreply.github.com>
Sat, 30 Apr 2016 10:25:51 +0000 (11:25 +0100)
fixes #71

i3lock.c

index df5d952f2c1ab6b8f0436cad8943c446a672c735..928953b2346fced50639bd4260820737fa0cbd74 100644 (file)
--- a/i3lock.c
+++ b/i3lock.c
@@ -367,9 +367,13 @@ static void handle_key_press(xcb_key_press_event_t *event) {
     }
 
     switch (ksym) {
+        case XKB_KEY_j:
         case XKB_KEY_Return:
         case XKB_KEY_KP_Enter:
         case XKB_KEY_XF86ScreenSaver:
+            if (ksym == XKB_KEY_j && !ctrl)
+                break;
+
             if (pam_state == STATE_PAM_WRONG)
                 return;
 
@@ -414,7 +418,11 @@ static void handle_key_press(xcb_key_press_event_t *event) {
              * see issue #50. */
             return;
 
+        case XKB_KEY_h:
         case XKB_KEY_BackSpace:
+            if (ksym == XKB_KEY_h && !ctrl)
+                break;
+
             if (input_position == 0)
                 return;
 
@@ -423,7 +431,7 @@ static void handle_key_press(xcb_key_press_event_t *event) {
             password[input_position] = '\0';
 
             /* Hide the unlock indicator after a bit if the password buffer is
-         * empty. */
+             * empty. */
             START_TIMER(clear_indicator_timeout, 1.0, clear_indicator_cb);
             unlock_state = STATE_BACKSPACE_ACTIVE;
             redraw_screen();