]> git.saurik.com Git - wxWidgets.git/commitdiff
scope added for keyboard handler
authorStefan Csomor <csomor@advancedconcepts.ch>
Mon, 18 Aug 2003 09:56:07 +0000 (09:56 +0000)
committerStefan Csomor <csomor@advancedconcepts.ch>
Mon, 18 Aug 2003 09:56:07 +0000 (09:56 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@22991 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/mac/carbon/toplevel.cpp
src/mac/toplevel.cpp

index b774abc5d0928587144e3f0386b61f596cfeb0d1..7fc8dc68c364f7ffaabe2e54e35d50d8d9bfbd38 100644 (file)
@@ -176,15 +176,17 @@ static pascal OSStatus KeyboardEventHandler( EventHandlerCallRef handler , Event
     {
         case kEventRawKeyRepeat :
         case kEventRawKeyDown :
     {
         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(
             break ;
         case kEventRawKeyUp :
             if ( (focus != NULL) && wxTheApp->MacSendKeyUpEvent(
index b774abc5d0928587144e3f0386b61f596cfeb0d1..7fc8dc68c364f7ffaabe2e54e35d50d8d9bfbd38 100644 (file)
@@ -176,15 +176,17 @@ static pascal OSStatus KeyboardEventHandler( EventHandlerCallRef handler , Event
     {
         case kEventRawKeyRepeat :
         case kEventRawKeyDown :
     {
         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(
             break ;
         case kEventRawKeyUp :
             if ( (focus != NULL) && wxTheApp->MacSendKeyUpEvent(