diff --git a/gtk2_ardour/editor_canvas_events.cc b/gtk2_ardour/editor_canvas_events.cc index 7dc3850352..ca475bf40d 100644 --- a/gtk2_ardour/editor_canvas_events.cc +++ b/gtk2_ardour/editor_canvas_events.cc @@ -410,6 +410,18 @@ Editor::canvas_automation_track_event (GdkEvent *event, ArdourCanvas::Item* item ret = leave_handler (item, event, AutomationTrackItem); break; + case GDK_KEY_PRESS: + if (_drags->active()) { + return _drags->mid_drag_key_event (&event->key); + } + break; + + case GDK_KEY_RELEASE: + if (_drags->active()) { + return _drags->mid_drag_key_event (&event->key); + } + break; + default: break; } diff --git a/gtk2_ardour/editor_drag.cc b/gtk2_ardour/editor_drag.cc index 65b79d3173..3522dcba3d 100644 --- a/gtk2_ardour/editor_drag.cc +++ b/gtk2_ardour/editor_drag.cc @@ -157,6 +157,21 @@ DragManager::preview_video () const return false; } +bool +DragManager::mid_drag_key_event (GdkEventKey* ev) +{ + bool handled = false; + + for (auto & drag : _drags) { + if (drag->mid_drag_key_event (ev)) { + handled = true; + break; + } + } + + return handled; +} + void DragManager::start_grab (GdkEvent* e, Gdk::Cursor* c) { diff --git a/gtk2_ardour/editor_drag.h b/gtk2_ardour/editor_drag.h index 216b413abd..640a71eb17 100644 --- a/gtk2_ardour/editor_drag.h +++ b/gtk2_ardour/editor_drag.h @@ -95,7 +95,7 @@ public: ~DragManager (); bool motion_handler (GdkEvent *, bool); - + bool mid_drag_key_event (GdkEventKey*); void abort (); void add (Drag *); void set (Drag *, GdkEvent *, Gdk::Cursor* c = MouseCursors::invalid_cursor()); @@ -238,6 +238,8 @@ public: return true; } + virtual bool mid_drag_key_event (GdkEventKey*) { return false; } + bool initially_vertical() const { return _initially_vertical; }