1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-10-22 06:22:58 +02:00

Fix keyboard handling in Lyrics and MixerBoard windows

Apparently, this hasn't worked for a while.  At least back to 2.0.6
anyway.
This commit is contained in:
Leland Lucius
2015-08-09 18:23:32 -05:00
parent 9e0c0d1b34
commit 2a0f9da32d
5 changed files with 20 additions and 18 deletions

View File

@@ -1042,7 +1042,7 @@ void CommandManager::TellUserWhyDisallowed( wxUint32 flagsGot, wxUint32 flagsReq
///
///
///
bool CommandManager::FilterKeyEvent(AudacityProject *project, wxKeyEvent & evt)
bool CommandManager::FilterKeyEvent(AudacityProject *project, wxKeyEvent & evt, bool permit)
{
if (HandleMeta(evt))
{
@@ -1050,7 +1050,7 @@ bool CommandManager::FilterKeyEvent(AudacityProject *project, wxKeyEvent & evt)
}
// Any other keypresses must be destined for this project window.
if (wxGetTopLevelParent(wxWindow::FindFocus()) != project)
if (!permit && wxGetTopLevelParent(wxWindow::FindFocus()) != project)
{
return false;
}
@@ -1067,13 +1067,6 @@ bool CommandManager::FilterKeyEvent(AudacityProject *project, wxKeyEvent & evt)
return true;
}
if (project->HandleKeyDown(evt))
{
wxKeyEvent temp = evt;
temp.SetEventType(wxEVT_KEY_UP);
project->HandleKeyUp(temp);
}
return false;
}

View File

@@ -179,13 +179,17 @@ class AUDACITY_DLL_API CommandManager: public XMLTagHandler
//
// Modifying accelerators
//
void SetKeyFromName(wxString name, wxString key);
void SetKeyFromIndex(int i, wxString key);
//
// Executing commands
//
bool FilterKeyEvent(AudacityProject *project, wxKeyEvent & evt);
// "permit" allows filtering even if the active window is a child of the project.
// Lyrics and MixerTrackCluster classes use it.
bool FilterKeyEvent(AudacityProject *project, wxKeyEvent & evt, bool permit = false);
bool HandleCommandEntry(CommandListEntry * entry, wxUint32 flags, wxUint32 mask, const wxEvent * evt = NULL);
bool HandleMenuID(int id, wxUint32 flags, wxUint32 mask);
bool HandleKey(wxKeyEvent &evt, wxUint32 flags, wxUint32 mask);