diff --git a/src/TrackPanel.cpp b/src/TrackPanel.cpp index fdec159af..699263481 100644 --- a/src/TrackPanel.cpp +++ b/src/TrackPanel.cpp @@ -260,6 +260,19 @@ TrackPanel::TrackPanel(wxWindow * parent, wxWindowID id, #pragma warning( default: 4355 ) #endif { + // Whenever activation swaps between projects, the track panel "captures" + // the keyboard, which means its sub-cells like Label tracks are given + // the chance to process keystrokes before CommandManager. + std::once_flag flag; + std::call_once(flag, []{ + wxTheApp->Bind(EVT_PROJECT_ACTIVATION, + [](wxCommandEvent &){ + auto pProject = GetActiveProject(); + if ( pProject ) + KeyboardCapture::Capture( &TrackPanel::Get( *pProject ) ); + }); + }); + SetLayoutDirection(wxLayout_LeftToRight); SetLabel(XO("Track Panel")); SetName(XO("Track Panel"));