i3 - improved tiling WM


added ctrl+u functionality for clearing passwords

Patch status: needinfo

Patch by Philip Dexter

To apply this patch, use:
curl http://cr.i3wm.org/patch/81/raw.patch | git am

b/i3lock.c

13
@@ -238,8 +238,11 @@ static void handle_key_press(xcb_key_press_event_t *event) {
14
     xkb_keysym_t ksym;
15
     char buffer[128];
16
     int n;
17
+    int ctrl;
18
+    char ctrl_string_buffer[8] = "Control";
19
 
20
     ksym = xkb_state_key_get_one_sym(xkb_state, event->detail);
21
+    ctrl = xkb_state_mod_name_is_active(xkb_state, ctrl_string_buffer, XKB_STATE_MODS_DEPRESSED);
22
     xkb_state_update_key(xkb_state, event->detail, XKB_KEY_DOWN);
23
 
24
     /* The buffer will be null-terminated, so n >= 2 for 1 actual character. */
25
@@ -254,6 +257,9 @@ static void handle_key_press(xcb_key_press_event_t *event) {
26
         unlock_state = STATE_KEY_PRESSED;
27
         redraw_screen();
28
         input_done();
29
+    case XKB_KEY_u:
30
+        if(!ctrl)
31
+            break;
32
     case XKB_KEY_Escape:
33
         input_position = 0;
34
         clear_password_memory();