mirror of
https://github.com/cookiengineer/audacity
synced 2025-06-15 23:59:37 +02:00
Handle Alt key down events, specifically for draw tool.
This commit is contained in:
parent
9d87ecd13f
commit
7a4a3e3951
@ -1650,6 +1650,9 @@ void AudacityProject::OnScroll(wxScrollEvent & event)
|
|||||||
|
|
||||||
bool AudacityProject::HandleKeyDown(wxKeyEvent & 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
|
// Allow the zoom cursor to change to a zoom out cursor
|
||||||
if (event.GetKeyCode() == WXK_SHIFT)
|
if (event.GetKeyCode() == WXK_SHIFT)
|
||||||
mTrackPanel->HandleShiftKey(true);
|
mTrackPanel->HandleShiftKey(true);
|
||||||
@ -1689,6 +1692,9 @@ bool AudacityProject::HandleChar(wxKeyEvent & event)
|
|||||||
|
|
||||||
bool AudacityProject::HandleKeyUp(wxKeyEvent & event)
|
bool AudacityProject::HandleKeyUp(wxKeyEvent & event)
|
||||||
{
|
{
|
||||||
|
if (event.GetKeyCode() == WXK_ALT)
|
||||||
|
mTrackPanel->HandleAltKey(false);
|
||||||
|
|
||||||
// Allow the Zoom Out cursor back to Zoom In
|
// Allow the Zoom Out cursor back to Zoom In
|
||||||
if (event.GetKeyCode() == WXK_SHIFT)
|
if (event.GetKeyCode() == WXK_SHIFT)
|
||||||
mTrackPanel->HandleShiftKey(false);
|
mTrackPanel->HandleShiftKey(false);
|
||||||
|
@ -1423,6 +1423,12 @@ void TrackPanel::MakeParentResize()
|
|||||||
mListener->TP_HandleResize();
|
mListener->TP_HandleResize();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void TrackPanel::HandleAltKey(bool down)
|
||||||
|
{
|
||||||
|
mLastMouseEvent.m_altDown = down;
|
||||||
|
HandleCursorForLastMouseEvent();
|
||||||
|
}
|
||||||
|
|
||||||
void TrackPanel::HandleShiftKey(bool down)
|
void TrackPanel::HandleShiftKey(bool down)
|
||||||
{
|
{
|
||||||
mLastMouseEvent.m_shiftDown = down;
|
mLastMouseEvent.m_shiftDown = down;
|
||||||
|
@ -224,6 +224,7 @@ class AUDACITY_DLL_API TrackPanel:public wxPanel {
|
|||||||
//virtual void SetSelectionFormat(int iformat)
|
//virtual void SetSelectionFormat(int iformat)
|
||||||
//virtual void SetSnapTo(int snapto)
|
//virtual void SetSnapTo(int snapto)
|
||||||
|
|
||||||
|
virtual void HandleAltKey(bool down);
|
||||||
virtual void HandleShiftKey(bool down);
|
virtual void HandleShiftKey(bool down);
|
||||||
virtual void HandleControlKey(bool down);
|
virtual void HandleControlKey(bool down);
|
||||||
virtual void HandlePageUpKey();
|
virtual void HandlePageUpKey();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user