1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-05-03 17:19:43 +02:00

Merge branch 'Escape-key'

This commit is contained in:
Paul-Licameli 2015-04-09 15:57:43 -04:00
commit c0506b479d
2 changed files with 21 additions and 0 deletions

View File

@ -1468,6 +1468,21 @@ void TrackPanel::MakeParentResize()
mListener->TP_HandleResize();
}
void TrackPanel::HandleEscapeKey()
{
switch (mMouseCapture)
{
case IsZooming:
case IsVZooming:
SetCapturedTrack(NULL, IsUncaptured);
if (HasCapture())
ReleaseCapture();
return;
default:
return;
}
}
void TrackPanel::HandleAltKey(bool down)
{
mLastMouseEvent.m_altDown = down;
@ -5963,6 +5978,11 @@ void TrackPanel::OnKeyDown(wxKeyEvent & event)
{
Track *t = GetFocusedTrack();
if (event.GetKeyCode() == WXK_ESCAPE) {
HandleEscapeKey();
return;
}
#ifdef EXPERIMENTAL_SPECTRAL_EDITING
#ifdef SPECTRAL_EDITING_ESC_KEY
// Test for pinning and unpinning of the center frequency

View File

@ -208,6 +208,7 @@ class AUDACITY_DLL_API TrackPanel:public wxPanel {
//virtual void SetSelectionFormat(int iformat)
//virtual void SetSnapTo(int snapto)
void HandleEscapeKey();
virtual void HandleAltKey(bool down);
virtual void HandleShiftKey(bool down);
virtual void HandleControlKey(bool down);