diff --git a/src/Lyrics.cpp b/src/Lyrics.cpp index 2faae7421..3f51fa081 100644 --- a/src/Lyrics.cpp +++ b/src/Lyrics.cpp @@ -461,6 +461,7 @@ void Lyrics::OnKeyEvent(wxKeyEvent & event) { AudacityProject *project = GetActiveProject(); project->GetCommandManager()->FilterKeyEvent(project, event, true); + event.Skip(); } void Lyrics::OnPaint(wxPaintEvent & WXUNUSED(event)) diff --git a/src/commands/CommandManager.cpp b/src/commands/CommandManager.cpp index 4cb906efc..17ba4d187 100644 --- a/src/commands/CommandManager.cpp +++ b/src/commands/CommandManager.cpp @@ -1204,12 +1204,17 @@ bool CommandManager::FilterKeyEvent(AudacityProject *project, const wxKeyEvent & { wxWindow * pWnd = wxWindow::FindFocus(); wxWindow * pTrackPanel = (wxWindow*)GetActiveProject()->GetTrackPanel(); + bool bIntercept = pWnd != pTrackPanel; + // Intercept keys from windows that are NOT panels + if( bIntercept ){ + bIntercept = pWnd && ( dynamic_cast(pWnd) == NULL ); + } //wxLogDebug("Focus: %p TrackPanel: %p", pWnd, pTrackPanel ); // We allow the keystrokes below to be handled by wxWidgets controls IF we are // in some sub window rather than in the TrackPanel itself. // Otherwise they will go to our command handler and if it handles them // they will NOT be available to wxWidgets. - if( pWnd != pTrackPanel ){ + if( bIntercept ){ switch( evt.GetKeyCode() ){ case WXK_LEFT: case WXK_RIGHT: