From: Stefan Csomor Date: Mon, 18 Aug 2003 09:56:07 +0000 (+0000) Subject: scope added for keyboard handler X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/404f1d80d8211110151f5e89591805ee5e0dc555?ds=sidebyside scope added for keyboard handler git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@22991 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/mac/carbon/toplevel.cpp b/src/mac/carbon/toplevel.cpp index b774abc5d0..7fc8dc68c3 100644 --- a/src/mac/carbon/toplevel.cpp +++ b/src/mac/carbon/toplevel.cpp @@ -176,15 +176,17 @@ static pascal OSStatus KeyboardEventHandler( EventHandlerCallRef handler , Event { case kEventRawKeyRepeat : case kEventRawKeyDown : - WXEVENTREF formerEvent = wxTheApp->MacGetCurrentEvent() ; - WXEVENTHANDLERCALLREF formerHandler = wxTheApp->MacGetCurrentEventHandlerCallRef() ; - wxTheApp->MacSetCurrentEvent( event , handler ) ; - if ( (focus != NULL) && wxTheApp->MacSendKeyDownEvent( - focus , message , modifiers , when , point.h , point.v ) ) { - result = noErr ; + WXEVENTREF formerEvent = wxTheApp->MacGetCurrentEvent() ; + WXEVENTHANDLERCALLREF formerHandler = wxTheApp->MacGetCurrentEventHandlerCallRef() ; + wxTheApp->MacSetCurrentEvent( event , handler ) ; + if ( (focus != NULL) && wxTheApp->MacSendKeyDownEvent( + focus , message , modifiers , when , point.h , point.v ) ) + { + result = noErr ; + } + wxTheApp->MacSetCurrentEvent( formerEvent , formerHandler ) ; } - wxTheApp->MacSetCurrentEvent( formerEvent , formerHandler ) ; break ; case kEventRawKeyUp : if ( (focus != NULL) && wxTheApp->MacSendKeyUpEvent( diff --git a/src/mac/toplevel.cpp b/src/mac/toplevel.cpp index b774abc5d0..7fc8dc68c3 100644 --- a/src/mac/toplevel.cpp +++ b/src/mac/toplevel.cpp @@ -176,15 +176,17 @@ static pascal OSStatus KeyboardEventHandler( EventHandlerCallRef handler , Event { case kEventRawKeyRepeat : case kEventRawKeyDown : - WXEVENTREF formerEvent = wxTheApp->MacGetCurrentEvent() ; - WXEVENTHANDLERCALLREF formerHandler = wxTheApp->MacGetCurrentEventHandlerCallRef() ; - wxTheApp->MacSetCurrentEvent( event , handler ) ; - if ( (focus != NULL) && wxTheApp->MacSendKeyDownEvent( - focus , message , modifiers , when , point.h , point.v ) ) { - result = noErr ; + WXEVENTREF formerEvent = wxTheApp->MacGetCurrentEvent() ; + WXEVENTHANDLERCALLREF formerHandler = wxTheApp->MacGetCurrentEventHandlerCallRef() ; + wxTheApp->MacSetCurrentEvent( event , handler ) ; + if ( (focus != NULL) && wxTheApp->MacSendKeyDownEvent( + focus , message , modifiers , when , point.h , point.v ) ) + { + result = noErr ; + } + wxTheApp->MacSetCurrentEvent( formerEvent , formerHandler ) ; } - wxTheApp->MacSetCurrentEvent( formerEvent , formerHandler ) ; break ; case kEventRawKeyUp : if ( (focus != NULL) && wxTheApp->MacSendKeyUpEvent(