mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-23 20:14:05 +00:00
rename
This commit is contained in:
parent
e01c39c4fc
commit
d4a49fbf79
|
@ -51,15 +51,15 @@ void createMapping()
|
|||
return;
|
||||
}
|
||||
|
||||
CFDataRef dataRef = (CFDataRef)TISGetInputSourceProperty(inputSourceRef, kTISPropertyUnicodeKeyLayoutData);
|
||||
CFDataRef uchrDataRef = (CFDataRef)TISGetInputSourceProperty(inputSourceRef, kTISPropertyUnicodeKeyLayoutData);
|
||||
|
||||
const UCKeyboardLayout* keyboardLayoutPtr;
|
||||
const UCKeyboardLayout* UCkeyboardLayoutPtr;
|
||||
|
||||
if (dataRef) {
|
||||
keyboardLayoutPtr = (const UCKeyboardLayout*)CFDataGetBytePtr(dataRef);
|
||||
if (uchrDataRef) {
|
||||
UCkeyboardLayoutPtr = (const UCKeyboardLayout*)CFDataGetBytePtr(uchrDataRef);
|
||||
}
|
||||
|
||||
if (!keyboardLayoutPtr) {
|
||||
if (!UCkeyboardLayoutPtr) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -67,16 +67,17 @@ void createMapping()
|
|||
UInt32 theDeadKeyState = 0;
|
||||
UniCharCount theLength = 0;
|
||||
UniChar temp_char_buf;
|
||||
if (UCKeyTranslate(keyboardLayoutPtr, i, kUCKeyActionDown, 0, LMGetKbdType(),
|
||||
if (UCKeyTranslate(UCkeyboardLayoutPtr, i, kUCKeyActionDown, 0, LMGetKbdType(),
|
||||
kUCKeyTranslateNoDeadKeysBit, &theDeadKeyState, 1, &theLength,
|
||||
&temp_char_buf)
|
||||
== noErr
|
||||
&& theLength > 0) {
|
||||
if (isprint(temp_char_buf)) {
|
||||
mapping.emplace_back(ReverseMapEntry { temp_char, i });
|
||||
mapping.emplace_back(ReverseMapEntry { temp_char_buf, i });
|
||||
}
|
||||
}
|
||||
}
|
||||
mapping.shrink_to_fit();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue