diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2013-10-23 10:38:50 -0400 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2013-10-23 10:38:50 -0400 |
commit | 4f9e46976c45ad60007d87903a48f32cff48227f (patch) | |
tree | 716a3ed8a52e331a14926354f32d87f875521b6c /gtk2_ardour/piano_roll_header.cc | |
parent | fca33f903db7786cb69435cda6ea34871faae921 (diff) |
make middle-click on piano roll track header more usefully select/unselect notes
Diffstat (limited to 'gtk2_ardour/piano_roll_header.cc')
-rw-r--r-- | gtk2_ardour/piano_roll_header.cc | 38 |
1 files changed, 17 insertions, 21 deletions
diff --git a/gtk2_ardour/piano_roll_header.cc b/gtk2_ardour/piano_roll_header.cc index 3243f893c7..e784242ff1 100644 --- a/gtk2_ardour/piano_roll_header.cc +++ b/gtk2_ardour/piano_roll_header.cc @@ -514,31 +514,27 @@ PianoRollHeader::on_button_press_event (GdkEventButton* ev) { int note = _view.y_to_note(ev->y); - if (ev->button != 1) { - return false; - } - - if (editor().current_mouse_mode() == Editing::MouseRange) { + 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) { + + add_modal_grab(); _dragging = true; - } else { - - if (ev->type == GDK_BUTTON_PRESS && note >= 0 && note < 128) { - - add_modal_grab(); - _dragging = true; - - if (!_active_notes[note]) { - _active_notes[note] = true; - _clicked_note = note; - send_note_on(note); - - invalidate_note_range(note, note); - } else { - reset_clicked_note(note); - } + + if (!_active_notes[note]) { + _active_notes[note] = true; + _clicked_note = note; + send_note_on(note); + + invalidate_note_range(note, note); + } else { + reset_clicked_note(note); } } |