[libdazzle] shortcuts: Ignore Shift modifier if not impacting key value



commit d2c899380465fe1391c51b0b81eea62af2170831
Author: Martin Blanchard <tchaik gmx com>
Date:   Sun Sep 2 17:15:23 2018 +0100

    shortcuts: Ignore Shift modifier if not impacting key value
    
    Some keyboard layouts may require the use of the Shift modifier in order
    to access certain keys and this breaks shortcuts using these keys.
    
    https://gitlab.gnome.org/GNOME/libdazzle/issues/15

 src/shortcuts/dzl-shortcut-chord.c | 4 ++++
 1 file changed, 4 insertions(+)
---
diff --git a/src/shortcuts/dzl-shortcut-chord.c b/src/shortcuts/dzl-shortcut-chord.c
index a9d16ab..0d99b6f 100644
--- a/src/shortcuts/dzl-shortcut-chord.c
+++ b/src/shortcuts/dzl-shortcut-chord.c
@@ -114,6 +114,10 @@ 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 ((key->state & GDK_SHIFT_MASK) != 0 &&
+      self->keys[0].keyval == key->keyval)
+    self->keys[0].modifier &= ~GDK_SHIFT_MASK;
+
   if ((key->state & GDK_LOCK_MASK) == 0 &&
       self->keys[0].keyval != key->keyval)
     self->keys[0].modifier |= GDK_SHIFT_MASK;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]