From b72899d14208093e743b08798b32277c16cc733d Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 29 Dec 2013 00:19:17 +0000 Subject: [PATCH] Don't intercept accelerators in wxTextValidator in wxGTK. Key events with modifiers shouldn't be filtered by the validator as they are used as accelerators and not for the text entry at all. Closes #15777. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75453 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- docs/changes.txt | 4 ++++ src/common/valtext.cpp | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/docs/changes.txt b/docs/changes.txt index cbcc6b5012..fe91400fc3 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -15,6 +15,10 @@ All (GUI): - Add wxHtmlWindow::SetDefaultHTMLCursor() (Jeff A. Marr). - Add default ctor and Create() to wxContextHelpButton (Hanmac). +wxGTK: + +- Don't intercept accelerators in wxTextValidator. + wxMSW: - Make wxFILTER_INCLUDE_LIST in wxTextValidator actually usable. diff --git a/src/common/valtext.cpp b/src/common/valtext.cpp index 70bf904009..717902d269 100644 --- a/src/common/valtext.cpp +++ b/src/common/valtext.cpp @@ -308,6 +308,11 @@ void wxTextValidator::OnChar(wxKeyEvent& event) if (!m_validatorWindow) return; + // Don't process the accelerators, i.e. any keys with any modifiers except + // for Shift. + if ( event.GetModifiers() & ~wxMOD_SHIFT ) + return; + #if wxUSE_UNICODE // We only filter normal, printable characters. int keyCode = event.GetUnicodeKey();