s |= Keyboard::Level4Modifier;
}
- 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.
+ /* since all SINGLE 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;
+ string actual;
- if (lastmod == string::npos) {
- lower = PBD::downcase (str);
+ if (str.size() == 1) {
+ actual = PBD::downcase (str);
} else {
- lower = PBD::downcase (str.substr (lastmod+1));
+ actual = str;
}
- keyval = gdk_keyval_from_name (lower.c_str());
+ string::size_type lastmod = actual.find_last_of ('-');
+ guint keyval;
+
+ if (lastmod != string::npos) {
+ actual = PBD::downcase (str.substr (lastmod+1));
+ }
+
+ keyval = gdk_keyval_from_name (actual.c_str());
if (keyval == GDK_VoidSymbol || keyval == 0) {
return false;
{
KeybindingMap& kbm = get_keymap (op);
-
/* if shift was pressed, GDK will send us (e.g) 'E' rather than 'e'.
Our bindings all use the lower case character/keyname, so switch
to the lower case before doing the lookup.
return std::find_if(km.begin(), km.end(), ActionNameRegistered<KeybindingMap::const_iterator::value_type>(action_name)) != km.end();
}
-Bindings::KeybindingMap&
+Bindings::KeybindingMap&
Bindings::get_keymap (Operation op)
{
switch (op) {
}
}
-const Bindings::KeybindingMap&
+const Bindings::KeybindingMap&
Bindings::get_keymap (Operation op) const
{
switch (op) {
}
}
-Bindings::MouseButtonBindingMap&
+Bindings::MouseButtonBindingMap&
Bindings::get_mousemap (Operation op)
{
switch (op) {