]> git.saurik.com Git - wxWidgets.git/commitdiff
adapting char event handling to msw / gtk, see #13415, see #14197
authorStefan Csomor <csomor@advancedconcepts.ch>
Tue, 29 May 2012 15:26:27 +0000 (15:26 +0000)
committerStefan Csomor <csomor@advancedconcepts.ch>
Tue, 29 May 2012 15:26:27 +0000 (15:26 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71588 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/osx/cocoa/window.mm

index d6832303c6644ed670e4e0ea1fabf76d15f9704c..81569093a84617b8313bb4d6ba6e2388cc579bd1 100644 (file)
@@ -2407,7 +2407,7 @@ bool wxWidgetCocoaImpl::DoHandleKeyEvent(NSEvent *event)
 
     if ( !result )
     {
-        if ( IsUserPane() && [event type] == NSKeyDown)
+        if ( [event type] == NSKeyDown)
         {
             long keycode = wxOSXTranslateCocoaKey( event, wxEVT_CHAR );
             
@@ -2416,12 +2416,20 @@ bool wxWidgetCocoaImpl::DoHandleKeyEvent(NSEvent *event)
                 // eventually we could setup a doCommandBySelector catcher and retransform this into the wx key chars
                 wxKeyEvent wxevent2(wxevent) ;
                 wxevent2.SetEventType(wxEVT_CHAR);
+                SetupKeyEvent( wxevent2, event );
                 wxevent2.m_keyCode = keycode;
                 result = GetWXPeer()->OSXHandleKeyEvent(wxevent2);
             }
+            else if (wxevent.CmdDown())
+            {
+                wxKeyEvent wxevent2(wxevent) ;
+                wxevent2.SetEventType(wxEVT_CHAR);
+                SetupKeyEvent( wxevent2, event );
+                result = GetWXPeer()->OSXHandleKeyEvent(wxevent2);
+            }
             else
             {
-                if ( !wxevent.CmdDown() )
+                if ( IsUserPane() && !wxevent.CmdDown() )
                 {
                     if ( [m_osxView isKindOfClass:[NSScrollView class] ] )
                         [[(NSScrollView*)m_osxView documentView] interpretKeyEvents:[NSArray arrayWithObject:event]];