diff options
author | Robin Gareus <robin@gareus.org> | 2019-12-15 20:34:14 +0100 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2019-12-15 20:34:14 +0100 |
commit | 6fa14a1b47a9a62d5a9f8f89271535347f114578 (patch) | |
tree | 8cd3b695475505bd7a356ddbd4ed73bafd03a3dd /gtk2_ardour/pianokeyboard.cc | |
parent | e1c0f99ef2ae54e1782f0016db4867a2d0fd4e99 (diff) |
VKeybd: Pass on primary (Ctrl/Cmd) shortcuts
This allows Ctrl/Cmd+s (save) and Ctrl/Cmd+z (undo) etc shortcuts
to work, even though the virtual-keyboard is visible.
Diffstat (limited to 'gtk2_ardour/pianokeyboard.cc')
-rw-r--r-- | gtk2_ardour/pianokeyboard.cc | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/gtk2_ardour/pianokeyboard.cc b/gtk2_ardour/pianokeyboard.cc index 9323f4fbf0..c68b674742 100644 --- a/gtk2_ardour/pianokeyboard.cc +++ b/gtk2_ardour/pianokeyboard.cc @@ -30,6 +30,8 @@ #include <gdk/gdkkeysyms.h> #include <gtk/gtk.h> +#include "gtkmm2ext/keyboard.h" + #include "pianokeyboard.h" #ifndef M_PI @@ -559,6 +561,10 @@ get_keycode (GdkEventKey* event) bool APianoKeyboard::on_key_press_event (GdkEventKey* event) { + if (Gtkmm2ext::Keyboard::modifier_state_contains (event->state, Gtkmm2ext::Keyboard::PrimaryModifier)) { + return false; + } + char const* key = get_keycode (event); int note = key_binding (key); @@ -594,6 +600,9 @@ APianoKeyboard::on_key_press_event (GdkEventKey* event) bool APianoKeyboard::on_key_release_event (GdkEventKey* event) { + if (Gtkmm2ext::Keyboard::modifier_state_contains (event->state, Gtkmm2ext::Keyboard::PrimaryModifier)) { + return false; + } char const* key = get_keycode (event); if (!key) { |