1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-04-30 15:49:41 +02:00

Handle Alt key down events, specifically for draw tool.

This commit is contained in:
v.audacity 2013-08-09 01:03:34 +00:00
parent 9d87ecd13f
commit 7a4a3e3951
3 changed files with 13 additions and 0 deletions

View File

@ -1650,6 +1650,9 @@ void AudacityProject::OnScroll(wxScrollEvent & event)
bool AudacityProject::HandleKeyDown(wxKeyEvent & event)
{
if (event.GetKeyCode() == WXK_ALT)
mTrackPanel->HandleAltKey(true);
// Allow the zoom cursor to change to a zoom out cursor
if (event.GetKeyCode() == WXK_SHIFT)
mTrackPanel->HandleShiftKey(true);
@ -1689,6 +1692,9 @@ bool AudacityProject::HandleChar(wxKeyEvent & event)
bool AudacityProject::HandleKeyUp(wxKeyEvent & event)
{
if (event.GetKeyCode() == WXK_ALT)
mTrackPanel->HandleAltKey(false);
// Allow the Zoom Out cursor back to Zoom In
if (event.GetKeyCode() == WXK_SHIFT)
mTrackPanel->HandleShiftKey(false);

View File

@ -1423,6 +1423,12 @@ void TrackPanel::MakeParentResize()
mListener->TP_HandleResize();
}
void TrackPanel::HandleAltKey(bool down)
{
mLastMouseEvent.m_altDown = down;
HandleCursorForLastMouseEvent();
}
void TrackPanel::HandleShiftKey(bool down)
{
mLastMouseEvent.m_shiftDown = down;

View File

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