Skip to content
Snippets Groups Projects
Commit 0cae5a4c authored by Timur Pocheptsov's avatar Timur Pocheptsov Committed by Ulf Hermann
Browse files

Cocoa integration: fix incorrect keyboard mapping


When switching between different input sources, we have to update layouts.

Task-number: QTBUG-50865
Change-Id: I0c23c19b79a2102dcc533822b0f861c387582c6c
Reviewed-by: default avatarMorten Johan Sørvig <morten.sorvig@qt.io>
parent 28c831fa
Branches
Tags
No related merge requests found
...@@ -378,6 +378,10 @@ bool QCocoaKeyMapper::updateKeyboard() ...@@ -378,6 +378,10 @@ bool QCocoaKeyMapper::updateKeyboard()
currentInputSource = source; currentInputSource = source;
keyboard_dead = 0; keyboard_dead = 0;
const auto newMode = keyboard_mode;
deleteLayouts();
keyboard_mode = newMode;
return true; return true;
} }
...@@ -400,10 +404,8 @@ void QCocoaKeyMapper::clearMappings() ...@@ -400,10 +404,8 @@ void QCocoaKeyMapper::clearMappings()
void QCocoaKeyMapper::updateKeyMap(unsigned short macVirtualKey, QChar unicodeKey) void QCocoaKeyMapper::updateKeyMap(unsigned short macVirtualKey, QChar unicodeKey)
{ {
if (updateKeyboard()) { updateKeyboard();
// ### Qt 4 did this:
// QKeyMapper::changeKeyboard();
}
if (keyLayout[macVirtualKey]) if (keyLayout[macVirtualKey])
return; return;
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment