diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2016-03-02 16:17:54 -0500 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2016-03-02 16:18:03 -0500 |
commit | 9b55550f0b470055122b7ed655ed10f82f416763 (patch) | |
tree | d3f26039e1e5ccfd7a805e01b7a610919da9acc9 /libs/gtkmm2ext/bindings.cc | |
parent | d1f18b9994900e7df3de48e55934f92022e06352 (diff) |
force all KeyboardKeys in Bindings to be lower case
Diffstat (limited to 'libs/gtkmm2ext/bindings.cc')
-rw-r--r-- | libs/gtkmm2ext/bindings.cc | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/libs/gtkmm2ext/bindings.cc b/libs/gtkmm2ext/bindings.cc index a570ec2f85..aec2486803 100644 --- a/libs/gtkmm2ext/bindings.cc +++ b/libs/gtkmm2ext/bindings.cc @@ -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; } |