1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-11-21 08:27:13 +01:00

Fixes for bugs 1122 and 1113

Several other issues were also fixed (hopefully ;-)).

This is a major change to accelerator handling and keyboard
capturing.  Menu shortcuts, non-menu commands, label editing,
navigation, and basically anything else were you might use
the keyboard should be thoroughly tested.
This commit is contained in:
Leland Lucius
2015-08-08 00:01:24 -05:00
parent 534741de78
commit f36fe29f96
12 changed files with 365 additions and 310 deletions

View File

@@ -754,9 +754,6 @@ typedef int (AudacityApp::*SPECIALKEYEVENT)(wxKeyEvent&);
BEGIN_EVENT_TABLE(AudacityApp, wxApp)
EVT_QUERY_END_SESSION(AudacityApp::OnEndSession)
EVT_KEY_DOWN(AudacityApp::OnKeyDown)
EVT_CHAR(AudacityApp::OnChar)
EVT_KEY_UP(AudacityApp::OnKeyUp)
EVT_TIMER(kAudacityAppTimerID, AudacityApp::OnTimer)
#ifdef __WXMAC__
EVT_MENU(wxID_NEW, AudacityApp::OnMenuNew)
@@ -1899,63 +1896,6 @@ void AudacityApp::OnEndSession(wxCloseEvent & event)
}
}
void AudacityApp::OnKeyDown(wxKeyEvent & event)
{
// Not handled
event.Skip(true);
// Make sure this event is destined for a project window
AudacityProject *prj = GetActiveProject();
// TODO: I don't know how it can happen, but it did on 2006-07-06.
// I was switching between apps fairly quickly so maybe that has something
// to do with it.
if (!prj)
return;
if (prj->HandleKeyDown(event))
event.Skip(false);
}
void AudacityApp::OnChar(wxKeyEvent & event)
{
// Not handled
event.Skip(true);
// Make sure this event is destined for a project window
AudacityProject *prj = GetActiveProject();
// TODO: I don't know how it can happen, but it did on 2006-07-06.
// I was switching between apps fairly quickly so maybe that has something
// to do with it.
if (!prj)
return;
if (prj->HandleChar(event))
event.Skip(false);
}
void AudacityApp::OnKeyUp(wxKeyEvent & event)
{
// Not handled
event.Skip(true);
// Make sure this event is destined for a project window
AudacityProject *prj = GetActiveProject();
// TODO: I don't know how it can happen, but it did on 2006-07-06.
// I was switching between apps fairly quickly so maybe that has something
// to do with it.
if (!prj)
return;
if (prj != wxGetTopLevelParent(wxWindow::FindFocus()))
return;
if (prj->HandleKeyUp(event))
event.Skip(false);
}
void AudacityApp::AddFileToHistory(const wxString & name)
{
mRecentFiles->AddFileToHistory(name);