]> git.saurik.com Git - wxWidgets.git/commitdiff
Intercept some keys in wxMSW wxTextCtrl even if they're used as accelerators.
authorVadim Zeitlin <vadim@wxwidgets.org>
Fri, 11 Nov 2011 14:26:06 +0000 (14:26 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Fri, 11 Nov 2011 14:26:06 +0000 (14:26 +0000)
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

src/msw/textctrl.cpp

index 7393cdf0fac16307658cad4c616c6e142a825499..4792c8de81208969ee4a5abaa8e67205dd5f37b4 100644 (file)
@@ -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;