From: Vadim Zeitlin Date: Fri, 11 Nov 2011 14:26:06 +0000 (+0000) Subject: Intercept some keys in wxMSW wxTextCtrl even if they're used as accelerators. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/b062fade9feb1c14d9e26aba80a5098e107ea2a5 Intercept some keys in wxMSW wxTextCtrl even if they're used as accelerators. Bare (i.e. without any modifiers) Delete, Home and End keys are also required by the text control itself so don't handle them as accelerators when wxTextCtrl has focus. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69739 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/msw/textctrl.cpp b/src/msw/textctrl.cpp index 7393cdf0fa..4792c8de81 100644 --- a/src/msw/textctrl.cpp +++ b/src/msw/textctrl.cpp @@ -1780,8 +1780,19 @@ bool wxTextCtrl::MSWShouldPreProcessMessage(WXMSG* msg) // fall through case 0: - if ( IsMultiLine() && vkey == VK_RETURN ) - return false; + switch ( vkey ) + { + case VK_RETURN: + // This one is only special for multi line controls. + if ( !IsMultiLine() ) + break; + // fall through + + case VK_DELETE: + case VK_HOME: + case VK_END: + return false; + } // fall through case 2: break;