summaryrefslogtreecommitdiff
path: root/gtk2_ardour/pianokeyboard.cc
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2019-10-26 23:49:57 +0200
committerRobin Gareus <robin@gareus.org>2019-10-26 23:49:57 +0200
commit9fd0813d16e379890eaba29e407e27a66fd8eba1 (patch)
tree034eddc0b55a39c2c2946da03415c84fc914b235 /gtk2_ardour/pianokeyboard.cc
parentf1d614b15dd812d6d373520b0c4117dcd1c29c03 (diff)
Add support for single-octave "asdfg.." key-bindings
Diffstat (limited to 'gtk2_ardour/pianokeyboard.cc')
-rw-r--r--gtk2_ardour/pianokeyboard.cc66
1 files changed, 65 insertions, 1 deletions
diff --git a/gtk2_ardour/pianokeyboard.cc b/gtk2_ardour/pianokeyboard.cc
index 85187ce116..0e4e677e2f 100644
--- a/gtk2_ardour/pianokeyboard.cc
+++ b/gtk2_ardour/pianokeyboard.cc
@@ -462,6 +462,65 @@ APianoKeyboard::bind_keys_dvorak ()
#endif
}
+void
+APianoKeyboard::bind_keys_basic_qwerty ()
+{
+ clear_notes ();
+
+ bind_key ("space", 128);
+
+ /* simple - middle rows only */
+ bind_key ("a", 12); /* C0 */
+ bind_key ("w", 13);
+ bind_key ("s", 14);
+ bind_key ("e", 15);
+ bind_key ("d", 16);
+ bind_key ("f", 17);
+ bind_key ("t", 18);
+ bind_key ("g", 19);
+ bind_key ("y", 20);
+ bind_key ("h", 21);
+ bind_key ("u", 22);
+ bind_key ("j", 23);
+
+ bind_key ("k", 24); /* C1 */
+ bind_key ("o", 25);
+ bind_key ("l", 26);
+ bind_key ("p", 27);
+ bind_key ("semicolon", 28);
+ bind_key ("apostrophe", 29);
+}
+
+void
+APianoKeyboard::bind_keys_basic_qwertz ()
+{
+ clear_notes ();
+
+ bind_key ("space", 128);
+
+ /* simple - middle rows only */
+ bind_key ("a", 12); /* C0 */
+ bind_key ("w", 13);
+ bind_key ("s", 14);
+ bind_key ("e", 15);
+ bind_key ("d", 16);
+ bind_key ("f", 17);
+ bind_key ("t", 18);
+ bind_key ("g", 19);
+ bind_key ("z", 20);
+ bind_key ("h", 21);
+ bind_key ("u", 22);
+ bind_key ("j", 23);
+
+ bind_key ("k", 24); /* C1 */
+ bind_key ("o", 25);
+ bind_key ("l", 26);
+ bind_key ("p", 27);
+ bind_key ("semicolon", 28);
+ bind_key ("apostrophe", 29);
+}
+
+
bool
APianoKeyboard::on_key_press_event (GdkEventKey* event)
{
@@ -825,7 +884,6 @@ APianoKeyboard::set_annotate_octave (bool enabled)
void
APianoKeyboard::set_monophonic (bool monophonic)
{
-
_monophonic = monophonic;
}
@@ -978,6 +1036,12 @@ APianoKeyboard::set_keyboard_layout (Layout layout)
case DVORAK:
bind_keys_dvorak ();
break;
+ case S_QWERTY:
+ bind_keys_basic_qwerty ();
+ break;
+ case S_QWERTZ:
+ bind_keys_basic_qwertz ();
+ break;
}
queue_draw ();
}