From 4358b585f17e6b7cb8fb623b403d0a3cdeed2a3a Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 1 Apr 2007 15:19:44 +0000 Subject: [PATCH] blind fix for Unicode key handling (patch 1615989) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@45206 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- contrib/src/stc/stc.cpp.in | 7 +++++++ src/stc/stc.cpp.in | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/contrib/src/stc/stc.cpp.in b/contrib/src/stc/stc.cpp.in index 072d1c1cc2..af1773ddeb 100644 --- a/contrib/src/stc/stc.cpp.in +++ b/contrib/src/stc/stc.cpp.in @@ -756,6 +756,13 @@ void wxStyledTextCtrl::OnChar(wxKeyEvent& evt) { #endif bool skip = ((ctrl || alt) && ! (ctrl && alt)); +#if wxUSE_UNICODE + // apparently if we don't do this, Unicode keys pressed after non-char + // ASCII ones (e.g. Enter, Tab) are not taken into account (patch 1615989) + if (m_lastKeyDownConsumed && evt.GetUnicodeKey() > 255) + m_lastKeyDownConsumed = false; +#endif + if (!m_lastKeyDownConsumed && !skip) { #if wxUSE_UNICODE int key = evt.GetUnicodeKey(); diff --git a/src/stc/stc.cpp.in b/src/stc/stc.cpp.in index 072d1c1cc2..af1773ddeb 100644 --- a/src/stc/stc.cpp.in +++ b/src/stc/stc.cpp.in @@ -756,6 +756,13 @@ void wxStyledTextCtrl::OnChar(wxKeyEvent& evt) { #endif bool skip = ((ctrl || alt) && ! (ctrl && alt)); +#if wxUSE_UNICODE + // apparently if we don't do this, Unicode keys pressed after non-char + // ASCII ones (e.g. Enter, Tab) are not taken into account (patch 1615989) + if (m_lastKeyDownConsumed && evt.GetUnicodeKey() > 255) + m_lastKeyDownConsumed = false; +#endif + if (!m_lastKeyDownConsumed && !skip) { #if wxUSE_UNICODE int key = evt.GetUnicodeKey(); -- 2.45.2