X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/1e181c7a2c32193fc8138cc32ed07984eadd4a21..89efaf2b6595e59af618556d7e79492cab50c73c:/src/osx/cocoa/window.mm diff --git a/src/osx/cocoa/window.mm b/src/osx/cocoa/window.mm index a358f96dca..4594a4931d 100644 --- a/src/osx/cocoa/window.mm +++ b/src/osx/cocoa/window.mm @@ -11,7 +11,9 @@ #include "wx/wxprec.h" -#include +#ifndef WX_PRECOMP +#include "wx/nonownedwnd.h" +#endif #ifdef __WXMAC__ #include "wx/osx/private.h" @@ -110,6 +112,7 @@ long wxOSXTranslateCocoaKey(unsigned short code, int unichar ) void SetupKeyEvent( wxKeyEvent &wxevent , NSEvent * nsEvent ) { UInt32 modifiers = [nsEvent modifierFlags] ; + int eventType = [nsEvent type]; wxevent.m_shiftDown = modifiers & NSShiftKeyMask; wxevent.m_controlDown = modifiers & NSControlKeyMask; @@ -117,11 +120,14 @@ void SetupKeyEvent( wxKeyEvent &wxevent , NSEvent * nsEvent ) wxevent.m_metaDown = modifiers & NSCommandKeyMask; wxString chars; - NSString* nschars = [nsEvent characters]; - if ( nschars ) + if ( eventType != NSFlagsChanged ) { - wxCFStringRef cfchars((CFStringRef)[nschars retain]); - chars = cfchars.AsString(); + NSString* nschars = [nsEvent characters]; + if ( nschars ) + { + wxCFStringRef cfchars((CFStringRef)[nschars retain]); + chars = cfchars.AsString(); + } } int unichar = chars.Length() > 0 ? chars[0] : 0; @@ -134,7 +140,6 @@ void SetupKeyEvent( wxKeyEvent &wxevent , NSEvent * nsEvent ) wxevent.m_rawFlags = modifiers; wxevent.SetTimestamp( [nsEvent timestamp] * 1000.0 ) ; - int eventType = [nsEvent type]; switch (eventType) { case NSKeyDown : @@ -322,7 +327,7 @@ void SetupMouseEvent( wxMouseEvent &wxevent , NSEvent * nsEvent ) wxRegion updateRgn; const NSRect *rects; - int count ; + NSInteger count; [self getRectsBeingDrawn:&rects count:&count]; for ( int i = 0 ; i < count ; ++i ) @@ -713,6 +718,10 @@ void wxWidgetCocoaImpl::SetFont(wxFont const&, wxColour const&, long, bool) // TODO } +void wxWidgetCocoaImpl::InstallEventHandler( WXWidget control ) +{ +} + // // Factory methods //