From: Stefan Csomor Date: Tue, 29 May 2012 15:26:27 +0000 (+0000) Subject: adapting char event handling to msw / gtk, see #13415, see #14197 X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/09e7316547fadf0998abd9eade215db7845538dd adapting char event handling to msw / gtk, see #13415, see #14197 git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71588 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/osx/cocoa/window.mm b/src/osx/cocoa/window.mm index d6832303c6..81569093a8 100644 --- a/src/osx/cocoa/window.mm +++ b/src/osx/cocoa/window.mm @@ -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]];