feeds missed key events back to the control
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@20899 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -128,11 +128,26 @@ static pascal OSStatus TextInputEventHandler( EventHandlerCallRef handler , Even
|
|||||||
switch ( GetEventKind( event ) )
|
switch ( GetEventKind( event ) )
|
||||||
{
|
{
|
||||||
case kEventTextInputUnicodeForKeyEvent :
|
case kEventTextInputUnicodeForKeyEvent :
|
||||||
|
// this is only called when no default handler has jumped in, eg a wxControl on a floater window does not
|
||||||
|
// get its own kEventTextInputUnicodeForKeyEvent, so we route back the
|
||||||
|
wxControl* control = wxDynamicCast( focus , wxControl ) ;
|
||||||
|
if ( control )
|
||||||
|
{
|
||||||
|
ControlHandle macControl = (ControlHandle) control->GetMacControl() ;
|
||||||
|
if ( macControl )
|
||||||
|
{
|
||||||
|
::HandleControlKey( macControl , keyCode , charCode , modifiers ) ;
|
||||||
|
result = noErr ;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/*
|
||||||
|
// this may lead to double events sent to a window in case all handlers have skipped the key down event
|
||||||
if ( (focus != NULL) && wxTheApp->MacSendKeyDownEvent(
|
if ( (focus != NULL) && wxTheApp->MacSendKeyDownEvent(
|
||||||
focus , message , modifiers , when , point.h , point.v ) )
|
focus , message , modifiers , when , point.h , point.v ) )
|
||||||
{
|
{
|
||||||
result = noErr ;
|
result = noErr ;
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
break ;
|
break ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -128,11 +128,26 @@ static pascal OSStatus TextInputEventHandler( EventHandlerCallRef handler , Even
|
|||||||
switch ( GetEventKind( event ) )
|
switch ( GetEventKind( event ) )
|
||||||
{
|
{
|
||||||
case kEventTextInputUnicodeForKeyEvent :
|
case kEventTextInputUnicodeForKeyEvent :
|
||||||
|
// this is only called when no default handler has jumped in, eg a wxControl on a floater window does not
|
||||||
|
// get its own kEventTextInputUnicodeForKeyEvent, so we route back the
|
||||||
|
wxControl* control = wxDynamicCast( focus , wxControl ) ;
|
||||||
|
if ( control )
|
||||||
|
{
|
||||||
|
ControlHandle macControl = (ControlHandle) control->GetMacControl() ;
|
||||||
|
if ( macControl )
|
||||||
|
{
|
||||||
|
::HandleControlKey( macControl , keyCode , charCode , modifiers ) ;
|
||||||
|
result = noErr ;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/*
|
||||||
|
// this may lead to double events sent to a window in case all handlers have skipped the key down event
|
||||||
if ( (focus != NULL) && wxTheApp->MacSendKeyDownEvent(
|
if ( (focus != NULL) && wxTheApp->MacSendKeyDownEvent(
|
||||||
focus , message , modifiers , when , point.h , point.v ) )
|
focus , message , modifiers , when , point.h , point.v ) )
|
||||||
{
|
{
|
||||||
result = noErr ;
|
result = noErr ;
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
break ;
|
break ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user