macOS: Ensure cancelOperation is sent as regular key event

Since 9e1875483c the logic of sending
QKeyEvent was changed to only happen when we explicitly decided to not
treat input as complex text, or when a selector for a command was not
found. This missed the case where we handle cancelOperation by falling
back to sending a regular key event. We now set m_sendKeyEvent to true
to trigger this logic.

Fixes: QTBUG-97119
Pick-to: 6.2
Change-Id: Ibb72f4b068cce735db8d76e5e0a1882aae115207
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
This commit is contained in:
Wang Chuan 2021-10-06 00:08:28 +08:00 committed by Tor Arne Vestbø
parent 906cb8d4ef
commit 60caec953f

View File

@ -165,8 +165,10 @@
// Handling the key event may recurse back here through interpretKeyEvents
// (when IM is enabled), so we need to guard against that.
if (currentEvent == m_currentlyInterpretedKeyEvent)
if (currentEvent == m_currentlyInterpretedKeyEvent) {
m_sendKeyEvent = true;
return;
}
// Send Command+Key_Period and Escape as normal keypresses so that
// the key sequence is delivered through Qt. That way clients can