force all KeyboardKeys in Bindings to be lower case
authorPaul Davis <paul@linuxaudiosystems.com>
Wed, 2 Mar 2016 21:17:54 +0000 (16:17 -0500)
committerPaul Davis <paul@linuxaudiosystems.com>
Wed, 2 Mar 2016 21:18:03 +0000 (16:18 -0500)
libs/gtkmm2ext/bindings.cc

index a570ec2f85b264ebc7e2829834b7d8c7bb0a9d30..aec248680341afa540fb778d9cbbd09d2e3e18cf 100644 (file)
@@ -244,12 +244,23 @@ KeyboardKey::make_key (const string& str, KeyboardKey& k)
         string::size_type lastmod = str.find_last_of ('-');
         guint keyval;
 
+        /* since all key events keycodes are changed to lower case before
+         * looking them up, make sure we only store lower case here. The Shift
+         * part will be stored in the modifier part of the KeyboardKey.
+         *
+         * And yes Mildred, this doesn't cover CapsLock cases. Oh well.
+         */
+
+        string lower;
+
         if (lastmod == string::npos) {
-                keyval = gdk_keyval_from_name (str.c_str());
+               lower = PBD::downcase (str);
         } else {
-                keyval = gdk_keyval_from_name (str.substr (lastmod+1).c_str());
+               lower = PBD::downcase (str.substr (lastmod+1));
         }
 
+        keyval = gdk_keyval_from_name (lower.c_str());
+
         if (keyval == GDK_VoidSymbol || keyval == 0) {
                return false;
         }