From 60dbd0ce0d99141e57d1f0d866f76f226bcc2d48 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Tue, 27 Feb 2024 18:10:55 +0000 Subject: [PATCH] Add wxGrids to list of things that get arrow keys. Fixes https://gitlab.com/kicad/code/kicad/-/issues/17144 (cherry picked from commit f754410c7e4290124d6a51812aa1daedb1f5a7c9) --- common/widgets/paged_dialog.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/common/widgets/paged_dialog.cpp b/common/widgets/paged_dialog.cpp index e69cdcc983..9105a0f183 100644 --- a/common/widgets/paged_dialog.cpp +++ b/common/widgets/paged_dialog.cpp @@ -355,7 +355,8 @@ void PAGED_DIALOG::onCharHook( wxKeyEvent& aEvent ) { if( dynamic_cast( aEvent.GetEventObject() ) || dynamic_cast( aEvent.GetEventObject() ) - || dynamic_cast( aEvent.GetEventObject() ) ) + || dynamic_cast( aEvent.GetEventObject() ) + || dynamic_cast( FindFocus() ) ) { aEvent.Skip(); return; @@ -373,7 +374,7 @@ void PAGED_DIALOG::onCharHook( wxKeyEvent& aEvent ) m_treebook->SetSelection( page - 1 ); } - m_treebook->GetTreeCtrl()->SetFocus(); // Don't allow preview canvas to steal focus + m_treebook->GetTreeCtrl()->SetFocus(); // Don't allow preview canvas to steal gridFocus } else if( aEvent.GetKeyCode() == WXK_DOWN ) { @@ -381,7 +382,7 @@ void PAGED_DIALOG::onCharHook( wxKeyEvent& aEvent ) m_treebook->SetSelection( std::min( page + 1, m_treebook->GetPageCount() - 1 ) ); - m_treebook->GetTreeCtrl()->SetFocus(); // Don't allow preview canvas to steal focus + m_treebook->GetTreeCtrl()->SetFocus(); // Don't allow preview canvas to steal gridFocus } else {