Send key down events ourselves if macOS didn't do it
Set a flag in insertText and send wxEVT_KEY_DOWN ourselves from DoHandleKeyEvent() if it wasn't set to ensure that we generate these events for the keys ignored by the standard insertText, such as ⌘+⎇+Letter combination. Closes #23671. See #23699.
This commit is contained in:
parent
e38bc95548
commit
30fbb94053
1 changed files with 10 additions and 0 deletions
|
|
@ -2166,6 +2166,7 @@ void wxWidgetCocoaImpl::insertText(NSString* text, WXWidget slf, void *_cmd)
|
|||
wxKeyEvent wxevent(wxEVT_KEY_DOWN);
|
||||
SetupKeyEvent( wxevent, GetLastNativeKeyDownEvent() );
|
||||
result = GetWXPeer()->OSXHandleKeyEvent(wxevent);
|
||||
SetKeyDownSent();
|
||||
}
|
||||
|
||||
// ...and wxEVT_CHAR.
|
||||
|
|
@ -3883,6 +3884,15 @@ bool wxWidgetCocoaImpl::DoHandleKeyEvent(NSEvent *event)
|
|||
[[(NSScrollView*)m_osxView documentView] interpretKeyEvents:[NSArray arrayWithObject:event]];
|
||||
else
|
||||
[m_osxView interpretKeyEvents:[NSArray arrayWithObject:event]];
|
||||
|
||||
if ( IsInNativeKeyDown() && !WasKeyDownSent())
|
||||
{
|
||||
wxLogTrace(TRACE_KEYS, "Emulating missing key down event");
|
||||
|
||||
wxKeyEvent wxevent(wxEVT_KEY_DOWN);
|
||||
SetupKeyEvent( wxevent, GetLastNativeKeyDownEvent() );
|
||||
GetWXPeer()->OSXHandleKeyEvent(wxevent);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
else
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue