From cad824d089aa8610bb6575e42d0e6fd30f04e433 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 17 Feb 2018 19:06:32 +0100 Subject: [PATCH] Let windows with wxWANTS_CHARS have TAB presses under Mac This notably fixes the use of TAB in wxStyledTextCtrl, where it's supposed to be handled by the control itself and not as a navigation key, but is more general than this. Fixes a regression from 8bca6deda302ae7e26da2892160f2784aa4335bb. Closes #17999. --- src/osx/cocoa/window.mm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/osx/cocoa/window.mm b/src/osx/cocoa/window.mm index 3f261bbee4a2..e7f5e4fc585c 100644 --- a/src/osx/cocoa/window.mm +++ b/src/osx/cocoa/window.mm @@ -3552,8 +3552,9 @@ new wxCocoaGesturesImpl(this, m_osxView, eventsMask) bool wxWidgetCocoaImpl::ShouldHandleKeyNavigation(const wxKeyEvent &WXUNUSED(event)) const { - // Only controls that intercept tabs for different behavior should return false (ie wxTE_PROCESS_TAB) - return true; + // If the window wants to have all keys, let it have it and don't process + // TAB as key navigation event. + return !m_wxPeer->HasFlag(wxWANTS_CHARS); } bool wxWidgetCocoaImpl::DoHandleKeyNavigation(const wxKeyEvent &event)