From f14f5c67406c9231ad3cf673db3a3757e47d49ef Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 21 Sep 2002 11:44:49 +0000 Subject: [PATCH] don't set Alt/Ctrl modifiers for the AltGr char events git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@17316 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/msw/window.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/msw/window.cpp b/src/msw/window.cpp index 07d4a17190..0d3aa9a858 100644 --- a/src/msw/window.cpp +++ b/src/msw/window.cpp @@ -4378,9 +4378,18 @@ bool wxWindowMSW::HandleChar(WXWPARAM wParam, WXLPARAM lParam, bool isASCII) } wxKeyEvent event(CreateKeyEvent(wxEVT_CHAR, id, lParam, wParam)); - if ( ctrlDown ) + + // the alphanumeric keys produced by pressing AltGr+something on European + // keyboards have both Ctrl and Alt modifiers which may confuse the user + // code as, normally, keys with Ctrl and/or Alt don't result in anything + // alphanumeric, so pretend that there are no modifiers at all (the + // KEY_DOWN event would still have the correct modifiers if they're really + // needed) + if ( event.m_controlDown && event.m_altDown && + (id >= 32 && id < 256) ) { - event.m_controlDown = TRUE; + event.m_controlDown = + event.m_altDown = FALSE; } return GetEventHandler()->ProcessEvent(event);