From: Stefan Csomor Date: Sun, 19 Mar 2006 10:55:09 +0000 (+0000) Subject: rewire char events in case there is no focusable control on a tlw X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/ffc75ee4523ad45e3e3896be176ee2b1425db8cf rewire char events in case there is no focusable control on a tlw git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@38217 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/mac/carbon/toplevel.cpp b/src/mac/carbon/toplevel.cpp index c4cd59574e..e176c02796 100644 --- a/src/mac/carbon/toplevel.cpp +++ b/src/mac/carbon/toplevel.cpp @@ -86,13 +86,15 @@ extern long wxMacTranslateKey(unsigned char key, unsigned char code) ; static const EventTypeSpec eventList[] = { // TODO: remove control related event like key and mouse (except for WindowLeave events) -#if 1 + { kEventClassKeyboard, kEventRawKeyDown } , { kEventClassKeyboard, kEventRawKeyRepeat } , { kEventClassKeyboard, kEventRawKeyUp } , { kEventClassKeyboard, kEventRawKeyModifiersChanged } , -#endif + { kEventClassTextInput, kEventTextInputUnicodeForKeyEvent } , + { kEventClassTextInput, kEventTextInputUpdateActiveInputArea } , + { kEventClassWindow , kEventWindowShown } , { kEventClassWindow , kEventWindowActivated } , { kEventClassWindow , kEventWindowDeactivated } , @@ -795,12 +797,19 @@ static pascal OSStatus wxMacTopLevelWindowEventHandler( EventHandlerCallRef hand return result ; } +// mix this in from window.cpp +pascal OSStatus wxMacUnicodeTextEventHandler( EventHandlerCallRef handler , EventRef event , void *data ) ; + pascal OSStatus wxMacTopLevelEventHandler( EventHandlerCallRef handler , EventRef event , void *data ) { OSStatus result = eventNotHandledErr ; switch ( GetEventClass( event ) ) { + case kEventClassTextInput : + result = wxMacUnicodeTextEventHandler( handler, event , data ) ; + break ; + case kEventClassKeyboard : result = KeyboardEventHandler( handler, event , data ) ; break ;