13
0

Support keyboard shift-click to select many notes.

Also support selecting with button 1 if shift is held, more discoverable.
This commit is contained in:
David Robillard 2014-12-06 22:02:25 -05:00
parent 39da38dd6e
commit f4a30e1f60

View File

@ -513,17 +513,15 @@ bool
PianoRollHeader::on_button_press_event (GdkEventButton* ev) PianoRollHeader::on_button_press_event (GdkEventButton* ev)
{ {
int note = _view.y_to_note(ev->y); int note = _view.y_to_note(ev->y);
bool tertiary = Keyboard::modifier_state_contains (ev->state, Keyboard::TertiaryModifier);
if (ev->button == 2 && ev->type == GDK_BUTTON_PRESS) { if (ev->button == 2 && Keyboard::no_modifiers_active (ev->state)) {
if (Keyboard::no_modifiers_active (ev->state)) { SetNoteSelection (note); // EMIT SIGNAL
SetNoteSelection (note); // EMIT SIGNAL return true;
return true; } else if (tertiary && (ev->button == 1 || ev->button == 2)) {
} ExtendNoteSelection (note); // EMIT SIGNAL
return false; return true;
} } else if (ev->button == 1 && note >= 0 && note < 128) {
if (ev->button == 1 && ev->type == GDK_BUTTON_PRESS && note >= 0 && note < 128) {
add_modal_grab(); add_modal_grab();
_dragging = true; _dragging = true;