mirror of
https://github.com/Raymo111/i3lock-color.git
synced 2025-02-24 16:06:26 -05:00
support ISO_Level5_Shift (Thanks roland)
This commit is contained in:
parent
7fdda76a51
commit
2dd03ce7db
1 changed files with 13 additions and 4 deletions
17
i3lock.c
17
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();
|
||||
|
|
Loading…
Add table
Reference in a new issue