1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-08-02 17:09:26 +02:00

Fix for 1753: keyboard interaction with meter buttons broken

There are two problems with using Enter to press the meter drop down buttons:
1. It only works the first time.
2. If auto-select auto is on, then audio is auto-selected.

This was caused by commit a0ea5d6. The problem with this commit is that meters and sliders are also derived from wxPanel, and therefore affected by the fix.

To fix this, make the above fix specific to the Lyrics panel.
This commit is contained in:
David Bailes 2017-10-11 10:56:08 +01:00 committed by Paul Licameli
parent c2f82181fc
commit cbfde23e42

View File

@ -89,6 +89,7 @@ CommandManager. It holds the callback for one command.
#include "../AudacityException.h" #include "../AudacityException.h"
#include "../Prefs.h" #include "../Prefs.h"
#include "../Project.h" #include "../Project.h"
#include "../Lyrics.h"
#include "Keyboard.h" #include "Keyboard.h"
#include "../PluginManager.h" #include "../PluginManager.h"
@ -1380,9 +1381,9 @@ bool CommandManager::FilterKeyEvent(AudacityProject *project, const wxKeyEvent &
wxWindow * pWnd = wxWindow::FindFocus(); wxWindow * pWnd = wxWindow::FindFocus();
wxWindow * pTrackPanel = (wxWindow*)GetActiveProject()->GetTrackPanel(); wxWindow * pTrackPanel = (wxWindow*)GetActiveProject()->GetTrackPanel();
bool bIntercept = pWnd != pTrackPanel; bool bIntercept = pWnd != pTrackPanel;
// Intercept keys from windows that are NOT panels // Intercept keys from windows that are NOT the Lyrics panel
if( bIntercept ){ if( bIntercept ){
bIntercept = pWnd && ( dynamic_cast<wxPanel*>(pWnd) == NULL ); bIntercept = pWnd && ( dynamic_cast<Lyrics*>(pWnd) == NULL );
} }
//wxLogDebug("Focus: %p TrackPanel: %p", pWnd, pTrackPanel ); //wxLogDebug("Focus: %p TrackPanel: %p", pWnd, pTrackPanel );
// We allow the keystrokes below to be handled by wxWidgets controls IF we are // We allow the keystrokes below to be handled by wxWidgets controls IF we are