diff --git a/gtk2_ardour/editor.cc b/gtk2_ardour/editor.cc index 26e57b59e6..7af556416d 100644 --- a/gtk2_ardour/editor.cc +++ b/gtk2_ardour/editor.cc @@ -698,7 +698,7 @@ Editor::Editor () signal_configure_event().connect (sigc::mem_fun (*ARDOUR_UI::instance(), &ARDOUR_UI::configure_handler)); signal_delete_event().connect (sigc::mem_fun (*ARDOUR_UI::instance(), &ARDOUR_UI::exit_on_main_window_close)); - Gtkmm2ext::Keyboard::the_keyboard().ShiftReleased.connect (sigc::mem_fun (*this, &Editor::shift_key_released)); + Gtkmm2ext::Keyboard::the_keyboard().ZoomVerticalModifierReleased.connect (sigc::mem_fun (*this, &Editor::zoom_vertical_modifier_released)); /* allow external control surfaces/protocols to do various things */ @@ -5510,7 +5510,7 @@ Editor::popup_control_point_context_menu (ArdourCanvas::Item* item, GdkEvent* ev } void -Editor::shift_key_released () +Editor::zoom_vertical_modifier_released() { _stepping_axis_view = 0; } diff --git a/gtk2_ardour/editor.h b/gtk2_ardour/editor.h index 12db349e39..566586ebe4 100644 --- a/gtk2_ardour/editor.h +++ b/gtk2_ardour/editor.h @@ -2053,15 +2053,16 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD bool _control_point_toggled_on_press; /** This is used by TimeAxisView to keep a track of the TimeAxisView that is currently being - stepped in height using Shift-Scrollwheel. When a scroll event occurs, we do the step on - this _stepping_axis_view if it is non-0 (and we set up this _stepping_axis_view with the - TimeAxisView underneath the mouse if it is 0). Then Editor resets _stepping_axis_view when - the shift key is released. In this (hacky) way, pushing shift and moving the scroll wheel - will operate on the same track until shift is released (rather than skipping about to whatever - happens to be underneath the mouse at the time). + stepped in height using ScrollZoomVerticalModifier+Scrollwheel. When a scroll event + occurs, we do the step on this _stepping_axis_view if it is non-0 (and we set up this + _stepping_axis_view with the TimeAxisView underneath the mouse if it is 0). Then Editor + resets _stepping_axis_view when the modifier key is released. In this (hacky) way, + pushing the modifier key and moving the scroll wheel will operate on the same track + until the key is released (rather than skipping about to whatever happens to be + underneath the mouse at the time). */ TimeAxisView* _stepping_axis_view; - void shift_key_released (); + void zoom_vertical_modifier_released(); friend class Drag; friend class RegionDrag; diff --git a/libs/gtkmm2ext/gtkmm2ext/keyboard.h b/libs/gtkmm2ext/gtkmm2ext/keyboard.h index 84988e1525..2c6b026a42 100644 --- a/libs/gtkmm2ext/gtkmm2ext/keyboard.h +++ b/libs/gtkmm2ext/gtkmm2ext/keyboard.h @@ -164,7 +164,7 @@ class Keyboard : public sigc::trackable, PBD::Stateful } }; - sigc::signal0 ShiftReleased; + sigc::signal0 ZoomVerticalModifierReleased; protected: static Keyboard* _the_keyboard; diff --git a/libs/gtkmm2ext/keyboard.cc b/libs/gtkmm2ext/keyboard.cc index f694471d9a..5087f61a23 100644 --- a/libs/gtkmm2ext/keyboard.cc +++ b/libs/gtkmm2ext/keyboard.cc @@ -248,12 +248,15 @@ Keyboard::snooper (GtkWidget *widget, GdkEventKey *event) keyval = event->keyval; } - if (keyval == GDK_Shift_L) { + if (event->state & ScrollZoomVerticalModifier) { /* There is a special and rather hacky situation in Editor which makes - it useful to know when a shift key has been released, so emit a signal - here (see Editor::_stepping_axis_view) + 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. */ - ShiftReleased (); /* EMIT SIGNAL */ + ZoomVerticalModifierReleased (); /* EMIT SIGNAL */ } if (event->type == GDK_KEY_PRESS) {