summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/cocoa/qcocoakeymapper.h
diff options
context:
space:
mode:
authorTor Arne Vestbø <tor.arne.vestbo@qt.io>2020-06-28 16:04:51 +0200
committerTor Arne Vestbø <tor.arne.vestbo@qt.io>2020-06-30 12:58:32 +0200
commit3021b1ecb7e1ec6e75e851c44f8ded9b8552235b (patch)
treed3b8260b0abb2004bb995ea08a64260226f1d6ca /src/plugins/platforms/cocoa/qcocoakeymapper.h
parentd962de314b0e78250952b5ea493bbe47f4f3e4c8 (diff)
Simplify QCocoaKeyMapper by always returning a valid keymap
QCocoaKeyMapper::updateKeyMap would always end up creating a valid key map, so the logic in CocoaKeyMapper::possibleKeys for dealing with missing keymaps was not needed, and was likely copied from one of the other key map implementations. Since we know that we have a key map we might as well return it after possibly updating it. Change-Id: If83974f4ddedae8b1acefbadef48da3ee326eadd Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Diffstat (limited to 'src/plugins/platforms/cocoa/qcocoakeymapper.h')
-rw-r--r--src/plugins/platforms/cocoa/qcocoakeymapper.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/plugins/platforms/cocoa/qcocoakeymapper.h b/src/plugins/platforms/cocoa/qcocoakeymapper.h
index bb39717b79..b2ad36712b 100644
--- a/src/plugins/platforms/cocoa/qcocoakeymapper.h
+++ b/src/plugins/platforms/cocoa/qcocoakeymapper.h
@@ -85,7 +85,7 @@ public:
private:
bool updateKeyboard();
void deleteLayouts();
- void updateKeyMap(unsigned short macVirtualKey, QChar unicodeKey);
+ KeyboardLayoutItem *keyMapForKey(unsigned short macVirtualKey, QChar unicodeKey) const;
void clearMappings();
QCFType<TISInputSourceRef> m_currentInputSource = nullptr;
@@ -93,8 +93,8 @@ private:
enum { NullMode, UnicodeMode, OtherMode } m_keyboardMode = NullMode;
const UCKeyboardLayout *m_keyboardLayoutFormat = nullptr;
KeyboardLayoutKind m_keyboardKind = kKLKCHRuchrKind;
- UInt32 m_deadKeyState = 0; // Maintains dead key state beween calls to UCKeyTranslate
- KeyboardLayoutItem *m_keyLayout[256];
+ mutable UInt32 m_deadKeyState = 0; // Maintains dead key state beween calls to UCKeyTranslate
+ mutable KeyboardLayoutItem *m_keyLayout[256];
};
QT_END_NAMESPACE