From 52e25acf221e5ac86ce648f6922620fb2d6a7121 Mon Sep 17 00:00:00 2001 From: YueLiang <38413990+Yue-Liang@users.noreply.github.com> Date: Mon, 21 Feb 2022 16:01:45 +0800 Subject: [PATCH] Fix bug for get natice keycode failed in mac (#66) TISCopyCurrentKeyboardInputSource will return null when using Chinese input method. Use TISCopyCurrentASCIICapableKeyboardLayoutInputSource instead. --- QHotkey/qhotkey_mac.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/QHotkey/qhotkey_mac.cpp b/QHotkey/qhotkey_mac.cpp index 2cf0db4..799f515 100644 --- a/QHotkey/qhotkey_mac.cpp +++ b/QHotkey/qhotkey_mac.cpp @@ -134,7 +134,7 @@ quint32 QHotkeyPrivateMac::nativeKeycode(Qt::Key keycode, bool &ok) UTF16Char ch = keycode; CFDataRef currentLayoutData; - TISInputSourceRef currentKeyboard = TISCopyCurrentKeyboardInputSource(); + TISInputSourceRef currentKeyboard = TISCopyCurrentASCIICapableKeyboardLayoutInputSource(); if (currentKeyboard == NULL) return 0;