]> git.saurik.com Git - wxWidgets.git/blobdiff - src/mac/toplevel.cpp
removed virtual modifier from Command handlers, added readonly and color information...
[wxWidgets.git] / src / mac / toplevel.cpp
index cc6cea4a30314f4bbf0c524a4015e67c97cf1a88..44af0896241b39ac646a4fc6839b91b37d5a0521 100644 (file)
@@ -234,6 +234,8 @@ void wxTopLevelWindowMac::SetIcon(const wxIcon& icon)
 
 EventHandlerUPP wxMacWindowEventHandlerUPP = NULL ;
 
+extern long wxMacTranslateKey(unsigned char key, unsigned char code) ;
+
 pascal OSStatus wxMacWindowEventHandler( EventHandlerCallRef handler , EventRef event , void *data )
 {
     OSStatus result = eventNotHandledErr ;
@@ -243,8 +245,18 @@ pascal OSStatus wxMacWindowEventHandler( EventHandlerCallRef handler , EventRef
         case kEventClassTextInput :
             if ( wxMacConvertEventToRecord( event , &rec ) )
             {
-                wxTheApp->MacHandleOneEvent( &rec ) ;
-                result = noErr ;
+                short keycode ;
+                short keychar ;
+                keychar = short(rec.message & charCodeMask);
+                keycode = short(rec.message & keyCodeMask) >> 8 ;
+                long keyval = wxMacTranslateKey(keychar, keycode) ;
+                wxWindow* focus = wxWindow::FindFocus() ;
+
+                if ( (focus != NULL) && wxTheApp->MacSendKeyDownEvent( focus , keyval , rec.modifiers , rec.when , rec.where.h , rec.where.v ) )
+                {
+                    // was handled internally
+                    result = noErr ;
+                }
             }
             break ;
         default :