Merge branch 'master' into windows
[ardour.git] / libs / gtkmm2ext / keyboard.cc
index 6328eb977c39492327ed7a55db6eff7cbcc5e57b..5087f61a237480f3359f0213fddb92f8ec13096e 100644 (file)
@@ -94,6 +94,11 @@ const char* Keyboard::rangeselect_modifier_name() { return S_("Key|Shift"); }
 guint Keyboard::GainFineScaleModifier = Keyboard::PrimaryModifier;
 guint Keyboard::GainExtraFineScaleModifier = Keyboard::SecondaryModifier;
 
+guint Keyboard::ScrollZoomVerticalModifier = Keyboard::SecondaryModifier;
+guint Keyboard::ScrollZoomHorizontalModifier = Keyboard::PrimaryModifier;
+guint Keyboard::ScrollHorizontalModifier = Keyboard::TertiaryModifier;
+
+
 Keyboard*    Keyboard::_the_keyboard = 0;
 Gtk::Window* Keyboard::current_window = 0;
 bool         Keyboard::_some_magic_widget_has_focus = false;
@@ -243,6 +248,17 @@ Keyboard::snooper (GtkWidget *widget, GdkEventKey *event)
                keyval = event->keyval;
        }
 
+       if (event->state & ScrollZoomVerticalModifier) {
+               /* There is a special and rather hacky situation in Editor which makes
+                  it useful to know when the modifier key for vertical zoom has been
+                  released, so emit a signal here (see Editor::_stepping_axis_view).
+                  Note that the state bit for the modifier key is set for the key-up
+                  event when the modifier is released, but not the key-down when it
+                  is pressed, so we get here on key-up, which is what we want.
+               */
+               ZoomVerticalModifierReleased (); /* EMIT SIGNAL */
+       }
+
        if (event->type == GDK_KEY_PRESS) {
 
                if (find (state.begin(), state.end(), keyval) == state.end()) {
@@ -523,7 +539,7 @@ Keyboard::load_keybindings (string path)
 
 
        } catch (...) {
-               error << string_compose (_("Ardour key bindings file not found at \"%1\" or contains errors."), path)
+               error << string_compose (_("key bindings file not found at \"%2\" or contains errors."), path)
                      << endmsg;
                return false;
        }