summaryrefslogtreecommitdiff
path: root/gtk2_ardour/piano_roll_header.cc
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2014-12-06 22:02:25 -0500
committerDavid Robillard <d@drobilla.net>2014-12-06 22:43:06 -0500
commitf4a30e1f607c285064daeea280dca209624be167 (patch)
treedf51e2b3bc453e44940a94816cb240dcc4036cb2 /gtk2_ardour/piano_roll_header.cc
parent39da38dd6edf1f137abe1bcf6abe97c06fcc1782 (diff)
Support keyboard shift-click to select many notes.
Also support selecting with button 1 if shift is held, more discoverable.
Diffstat (limited to 'gtk2_ardour/piano_roll_header.cc')
-rw-r--r--gtk2_ardour/piano_roll_header.cc20
1 files changed, 9 insertions, 11 deletions
diff --git a/gtk2_ardour/piano_roll_header.cc b/gtk2_ardour/piano_roll_header.cc
index 878cbb72d8..8a67ec7501 100644
--- a/gtk2_ardour/piano_roll_header.cc
+++ b/gtk2_ardour/piano_roll_header.cc
@@ -513,17 +513,15 @@ bool
PianoRollHeader::on_button_press_event (GdkEventButton* ev)
{
int note = _view.y_to_note(ev->y);
-
- if (ev->button == 2 && ev->type == GDK_BUTTON_PRESS) {
- if (Keyboard::no_modifiers_active (ev->state)) {
- SetNoteSelection (note); // EMIT SIGNAL
- return true;
- }
- return false;
- }
-
- if (ev->button == 1 && ev->type == GDK_BUTTON_PRESS && note >= 0 && note < 128) {
-
+ bool tertiary = Keyboard::modifier_state_contains (ev->state, Keyboard::TertiaryModifier);
+
+ if (ev->button == 2 && Keyboard::no_modifiers_active (ev->state)) {
+ SetNoteSelection (note); // EMIT SIGNAL
+ return true;
+ } else if (tertiary && (ev->button == 1 || ev->button == 2)) {
+ ExtendNoteSelection (note); // EMIT SIGNAL
+ return true;
+ } else if (ev->button == 1 && note >= 0 && note < 128) {
add_modal_grab();
_dragging = true;