mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-27 15:24:05 +00:00
rename
This commit is contained in:
parent
e01c39c4fc
commit
d4a49fbf79
|
@ -51,15 +51,15 @@ void createMapping()
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
CFDataRef dataRef = (CFDataRef)TISGetInputSourceProperty(inputSourceRef, kTISPropertyUnicodeKeyLayoutData);
|
CFDataRef uchrDataRef = (CFDataRef)TISGetInputSourceProperty(inputSourceRef, kTISPropertyUnicodeKeyLayoutData);
|
||||||
|
|
||||||
const UCKeyboardLayout* keyboardLayoutPtr;
|
const UCKeyboardLayout* UCkeyboardLayoutPtr;
|
||||||
|
|
||||||
if (dataRef) {
|
if (uchrDataRef) {
|
||||||
keyboardLayoutPtr = (const UCKeyboardLayout*)CFDataGetBytePtr(dataRef);
|
UCkeyboardLayoutPtr = (const UCKeyboardLayout*)CFDataGetBytePtr(uchrDataRef);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!keyboardLayoutPtr) {
|
if (!UCkeyboardLayoutPtr) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -67,16 +67,17 @@ void createMapping()
|
||||||
UInt32 theDeadKeyState = 0;
|
UInt32 theDeadKeyState = 0;
|
||||||
UniCharCount theLength = 0;
|
UniCharCount theLength = 0;
|
||||||
UniChar temp_char_buf;
|
UniChar temp_char_buf;
|
||||||
if (UCKeyTranslate(keyboardLayoutPtr, i, kUCKeyActionDown, 0, LMGetKbdType(),
|
if (UCKeyTranslate(UCkeyboardLayoutPtr, i, kUCKeyActionDown, 0, LMGetKbdType(),
|
||||||
kUCKeyTranslateNoDeadKeysBit, &theDeadKeyState, 1, &theLength,
|
kUCKeyTranslateNoDeadKeysBit, &theDeadKeyState, 1, &theLength,
|
||||||
&temp_char_buf)
|
&temp_char_buf)
|
||||||
== noErr
|
== noErr
|
||||||
&& theLength > 0) {
|
&& theLength > 0) {
|
||||||
if (isprint(temp_char_buf)) {
|
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