[libdazzle] shortcuts: ignore caps-lock similarly to gtk accelerators
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libdazzle] shortcuts: ignore caps-lock similarly to gtk accelerators
- Date: Thu, 29 Mar 2018 20:41:30 +0000 (UTC)
commit 635cbfc74a5943d1ab4298d0227623701af4d652
Author: Christian Hergert <chergert redhat com>
Date: Thu Mar 29 13:40:50 2018 -0700
shortcuts: ignore caps-lock similarly to gtk accelerators
This tries harder to ignore the caps lock situation so that a keybinding
still activates the same when caps lock is pressed.
Fixes #9
src/shortcuts/dzl-shortcut-chord.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/src/shortcuts/dzl-shortcut-chord.c b/src/shortcuts/dzl-shortcut-chord.c
index 1d42624..0706173 100644
--- a/src/shortcuts/dzl-shortcut-chord.c
+++ b/src/shortcuts/dzl-shortcut-chord.c
@@ -101,7 +101,8 @@ dzl_shortcut_chord_new_from_event (const GdkEventKey *key)
self->keys[0].keyval = gdk_keyval_to_lower (key->keyval);
self->keys[0].modifier = sanitize_modifier_mask (key->state);
- if (self->keys[0].keyval != key->keyval)
+ if ((key->state & GDK_LOCK_MASK) == 0 &&
+ self->keys[0].keyval != key->keyval)
self->keys[0].modifier |= GDK_SHIFT_MASK;
if (!dzl_shortcut_chord_is_valid (self))
@@ -154,7 +155,8 @@ dzl_shortcut_chord_append_event (DzlShortcutChord *self,
self->keys[i].keyval = gdk_keyval_to_lower (key->keyval);
self->keys[i].modifier = sanitize_modifier_mask (key->state);
- if (self->keys[i].keyval != key->keyval)
+ if ((key->state & GDK_LOCK_MASK) == 0 &&
+ self->keys[i].keyval != key->keyval)
self->keys[i].modifier |= GDK_SHIFT_MASK;
return TRUE;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]