13
0

Enable some key release event forwarding

This is needed for the virtual MIDI keyboard to trigger note-off events
This commit is contained in:
Robin Gareus 2019-11-22 22:12:48 +01:00
parent ceee42f7af
commit c456006f82
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04
4 changed files with 18 additions and 4 deletions

View File

@ -71,6 +71,20 @@ ArdourWindow::on_key_press_event (GdkEventKey* ev)
return handled;
}
bool
ArdourWindow::on_key_release_event (GdkEventKey* ev)
{
bool handled = Gtk::Window::on_key_press_event (ev);
if (!handled) {
if (!get_modal()) {
handled = relay_key_press (ev, this);
}
}
return handled;
}
bool
ArdourWindow::on_focus_in_event (GdkEventFocus *ev)
{

View File

@ -47,6 +47,7 @@ protected:
bool on_focus_out_event (GdkEventFocus*);
bool on_delete_event (GdkEventAny *);
bool on_key_press_event (GdkEventKey*);
bool on_key_release_event (GdkEventKey*);
void on_unmap ();
private:

View File

@ -275,8 +275,7 @@ Meterbridge::on_key_release_event (GdkEventKey* ev)
if (gtk_window_propagate_key_event (GTK_WINDOW(gobj()), ev)) {
return true;
}
/* don't forward releases */
return true;
return relay_key_press (ev, this);
}
bool

View File

@ -439,13 +439,13 @@ PluginUIWindow::on_key_release_event (GdkEventKey *event)
if (_pluginui) {
if (_pluginui->non_gtk_gui()) {
_pluginui->forward_key_event (event);
return true;
}
}
} else {
gtk_window_propagate_key_event (GTK_WINDOW(gobj()), event);
}
/* don't forward releases */
return true;
return relay_key_press (event, this);
}
void