From 6881163129c35852012bb6651cc7c88aed2465ca Mon Sep 17 00:00:00 2001 From: James Crook Date: Wed, 31 Aug 2016 23:38:54 +0100 Subject: [PATCH] Bug 1484 - (Residual) Alternative Ctrl-Click behaviour on Wave Previously Ctrl Click on Wave behaved exactly as Ctrl Click on Track Control Panel. With this change on wave it (a) No longer toggles. It only adds. (b) It will extend and can be drag extended. It is possible to change (a) to be toggle if that is desired. This should ease the creation and extension of discontinuous track selections. --- src/TrackPanel.cpp | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/src/TrackPanel.cpp b/src/TrackPanel.cpp index 6abb332d3..6def028ec 100644 --- a/src/TrackPanel.cpp +++ b/src/TrackPanel.cpp @@ -1961,14 +1961,24 @@ void TrackPanel::SelectionHandleClick(wxMouseEvent & event, bool stretch = HitTestStretch(pTrack, rect, event); #endif - if (event.ShiftDown() + bool bShiftDown = event.ShiftDown(); + bool bCtrlDown = event.ControlDown(); + if (bShiftDown || bCtrlDown #ifdef USE_MIDI && !stretch #endif ) { - ChangeSelectionOnShiftClick( pTrack ); + if( bShiftDown ) + ChangeSelectionOnShiftClick( pTrack ); + if( bCtrlDown ){ + //bool bIsSelected = pTrack->GetSelected(); + bool bIsSelected = false; + // could set bIsSelected true here, but toggling is more technically correct. + // if we want to match behaviour in Track Control Panel. + SelectTrack( pTrack, !bIsSelected, false ); + } double value; // Shift-click, choose closest boundary @@ -2757,7 +2767,8 @@ void TrackPanel::SelectionHandleDrag(wxMouseEvent & event, Track *clickedTrack) if (event.CmdDown()) { // Ctrl-drag has no meaning, fuhggeddaboudit - return; + // JKC YES it has meaning. + //return; } wxRect rect = mCapturedRect; @@ -6242,7 +6253,7 @@ bool TrackPanel::HandleTrackLocationMouseEvent(WaveTrack * track, wxRect &rect, bool bShift = event.ShiftDown(); bool bCtrlDown = event.ControlDown(); bool unsafe = IsUnsafe(); - + bCtrlDown = false; if( /*bShift ||*/ bCtrlDown ){ HandleListSelection(track, bShift, bCtrlDown, !unsafe);