i3lock-color

The world's most popular non-default computer lockscreen.
Index Commits Files Refs README LICENSE
commit 2dd03ce7db306e42aa938abef4d2e6227b26db59
parent 7fdda76a511c4679a2ffdb8e877bca9277772443
Author: Michael Stapelberg <michael@stapelberg.de>
Date:   Fri, 30 Dec 2011 03:13:24 +0100

support ISO_Level5_Shift (Thanks roland)

Diffstat:
Mi3lock.c | 17+++++++++++++----
1 file changed, 13 insertions(+), 4 deletions(-)
diff --git a/i3lock.c b/i3lock.c
@@ -55,6 +55,7 @@ static int input_position = 0;
 static char password[512];
 static bool modeswitch_active = false;
 static bool iso_level3_shift_active = false;
+static bool iso_level5_shift_active = false;
 static int modeswitchmask;
 static int numlockmask;
 static bool beep = false;
@@ -364,8 +365,8 @@ static void input_done() {
  *
  */
 static void handle_key_release(xcb_key_release_event_t *event) {
-    DEBUG("releasing key %d, state raw = %d, modeswitch_active = %d, iso_level3_shift_active = %d\n",
-          event->detail, event->state, modeswitch_active, iso_level3_shift_active);
+    DEBUG("releasing key %d, state raw = %d, modeswitch_active = %d, iso_level3_shift_active = %d, iso_level5_shift_active = %d\n",
+          event->detail, event->state, modeswitch_active, iso_level3_shift_active, iso_level5_shift_active);
 
     /* We don’t care about the column here and just use the first symbol. Since
      * we only check for Mode_switch and ISO_Level3_Shift, this *should* work.
@@ -377,9 +378,11 @@ static void handle_key_release(xcb_key_release_event_t *event) {
         modeswitch_active = false;
     } else if (sym == XK_ISO_Level3_Shift) {
         iso_level3_shift_active = false;
+    } else if (sym == XK_ISO_Level5_Shift) {
+        iso_level5_shift_active = false;
     }
-    DEBUG("release done. modeswitch_active = %d, iso_level3_shift_active = %d\n",
-          modeswitch_active, iso_level3_shift_active);
+    DEBUG("release done. modeswitch_active = %d, iso_level3_shift_active = %d, iso_level5_shift_active = %d\n",
+          modeswitch_active, iso_level3_shift_active, iso_level5_shift_active);
 }
 
 static void redraw_timeout(EV_P_ ev_timer *w, int revents) {
@@ -433,6 +436,8 @@ static void handle_key_press(xcb_key_press_event_t *event) {
         base_column = 2;
     if (iso_level3_shift_active)
         base_column = 4;
+    if (iso_level5_shift_active)
+        base_column = 6;
     sym0 = xcb_key_press_lookup_keysym(symbols, event, base_column);
     sym1 = xcb_key_press_lookup_keysym(symbols, event, base_column + 1);
     switch (sym0) {
@@ -444,6 +449,10 @@ static void handle_key_press(xcb_key_press_event_t *event) {
         DEBUG("ISO_Level3_Shift enabled\n");
         iso_level3_shift_active = true;
         return;
+    case XK_ISO_Level5_Shift:
+        DEBUG("ISO_Level5_Shift enabled\n");
+        iso_level5_shift_active = true;
+        return;
     case XK_Return:
     case XK_KP_Enter:
         input_done();