diff options
author | Anu Aliyas <anu.aliyas@qt.io> | 2024-03-07 08:19:23 +0100 |
---|---|---|
committer | Anu Aliyas <anu.aliyas@qt.io> | 2024-04-17 09:32:45 +0100 |
commit | 6adbc4cfb61913fc42f4673d6e24f09088f43327 (patch) | |
tree | af5f54a4ee2b5f624159d8a4c58b704a808c57f3 | |
parent | 1d1385a0479154391f9f273bd27951171baff15d (diff) |
Ensure that the correct modifier key is send to the chromium
QtWebEngine converts QtKeyEvent to NativeEvent and then forwards
it to Chromium. During the conversion, the value of
keyEvent->nativeModifiers is passed as the modifier, leading to
this issue. Eg: when using the command modifier, nativeModifiers
yielded 264 instead of the expected value NSEventModifierFlagCommand,
which is 1 << 20. Used QAppleKeyMapper::toCocoaModifiers() to get
NSEventModifierFlags from Qt::KeyboardModifiers
Fixes: QTBUG-122970
Pick-to: 6.7
Change-Id: I0c9d8df796187a04475fa944bf1cf4ba2a14109b
Reviewed-by: Michael BrĂ¼ning <michael.bruning@qt.io>
-rw-r--r-- | src/core/native_web_keyboard_event_qt_mac.mm | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/core/native_web_keyboard_event_qt_mac.mm b/src/core/native_web_keyboard_event_qt_mac.mm index 57c575699..0f5b12db4 100644 --- a/src/core/native_web_keyboard_event_qt_mac.mm +++ b/src/core/native_web_keyboard_event_qt_mac.mm @@ -47,7 +47,7 @@ base::apple::OwnedNSEvent ToNativeEvent(QKeyEvent *keyEvent) return base::apple::OwnedNSEvent([NSEvent keyEventWithType:type location:NSZeroPoint - modifierFlags:keyEvent->nativeModifiers() + modifierFlags:QAppleKeyMapper::toCocoaModifiers(keyEvent->modifiers()) timestamp:keyEvent->timestamp() / 1000 windowNumber:0 context:nil |