summaryrefslogtreecommitdiff
path: root/gtk2_ardour/pianokeyboard.cc
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2019-12-05 22:12:49 +0100
committerRobin Gareus <robin@gareus.org>2019-12-05 22:13:34 +0100
commit407c2bed63b8cfc7147128729cc5552b11c3e404 (patch)
tree79c31dd3825a18ab39eb4dfee02c02dad65988a5 /gtk2_ardour/pianokeyboard.cc
parent9eac4936dce7aae01febbe6b028e92d87b82a2d3 (diff)
VKeybd: grab and ignore some keys
With default QWERTY and QWERTZ layout some keys that are easily accidentally pressed. Those triggered editor actions, (e.g. "a" (audition), or "1" (edit-tool)) and are now ignored.
Diffstat (limited to 'gtk2_ardour/pianokeyboard.cc')
-rw-r--r--gtk2_ardour/pianokeyboard.cc15
1 files changed, 14 insertions, 1 deletions
diff --git a/gtk2_ardour/pianokeyboard.cc b/gtk2_ardour/pianokeyboard.cc
index 9c56ae8a0e..baf31c3005 100644
--- a/gtk2_ardour/pianokeyboard.cc
+++ b/gtk2_ardour/pianokeyboard.cc
@@ -356,6 +356,13 @@ APianoKeyboard::bind_keys_qwerty ()
bind_key ("o", 38);
bind_key ("0", 39);
bind_key ("p", 40);
+
+ /* ignore */
+ bind_key ("a", -2);
+ bind_key ("f", -3);
+ bind_key ("1", -4);
+ bind_key ("4", -5);
+ bind_key ("8", -6);
}
void
@@ -547,7 +554,10 @@ APianoKeyboard::on_key_press_event (GdkEventKey* event)
char* key = get_keycode (event);
int note = key_binding (key);
- if (note < 0) {
+ if (note < -1) {
+ return true;
+ }
+ else if (note < 0) {
return false;
}
@@ -592,6 +602,9 @@ APianoKeyboard::on_key_release_event (GdkEventKey* event)
sustain_release ();
return true;
}
+ if (note < -1) {
+ return true;
+ }
std::map<std::string, int>::const_iterator kv = _note_stack.find (key);
if (kv == _note_stack.end ()) {