Virtual MIDI keyboard, when visible, gets to handle keyboard input first
authorRobin Gareus <robin@gareus.org>
Fri, 22 Nov 2019 21:11:55 +0000 (22:11 +0100)
committerRobin Gareus <robin@gareus.org>
Fri, 22 Nov 2019 21:11:55 +0000 (22:11 +0100)
gtk2_ardour/ardour_ui_keys.cc

index 17c3ebeb731fe03237fbb0421aa307146cef4ee4..662eff576206340bb952f58e5e4e73bb0cfa70cb 100644 (file)
@@ -40,6 +40,7 @@
 #include "debug.h"
 #include "keyboard.h"
 #include "public_editor.h"
+#include "virtual_keyboard_window.h"
 
 using namespace ARDOUR;
 using namespace PBD;
@@ -54,6 +55,12 @@ ARDOUR_UI::key_event_handler (GdkEventKey* ev, Gtk::Window* event_window)
        Gtkmm2ext::Bindings* bindings = 0;
        Gtk::Window* window = 0;
 
+       if (virtual_keyboard_window && virtual_keyboard_window->is_visible()) {
+               if (gtk_window_propagate_key_event (virtual_keyboard_window->gobj(), ev)) {
+                       return true;
+               }
+       }
+
        /* until we get ardour bindings working, we are not handling key
         * releases yet.
         */