mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-27 15:24:05 +00:00
fix cmd+C+C not working under Japanese Input
This commit is contained in:
parent
519670ad18
commit
e92797a98a
|
@ -29,8 +29,16 @@ void createMapping()
|
|||
|
||||
CFDataRef dataRef = ( CFDataRef )TISGetInputSourceProperty( inputSourceRef,
|
||||
kTISPropertyUnicodeKeyLayoutData );
|
||||
// this method returns null under macos Japanese input method(and also Chinese), which causes cmd+C+C not to be registered as a hotkey
|
||||
if( !dataRef )
|
||||
return;
|
||||
{
|
||||
// solve the null value under Japanese keyboard
|
||||
inputSourceRef = TISCopyCurrentKeyboardLayoutInputSource();
|
||||
dataRef = static_cast<CFDataRef>((TISGetInputSourceProperty(inputSourceRef, kTISPropertyUnicodeKeyLayoutData)));
|
||||
if (!dataRef) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
const UCKeyboardLayout * keyboardLayoutPtr = ( const UCKeyboardLayout * )CFDataGetBytePtr( dataRef );
|
||||
if( !keyboardLayoutPtr )
|
||||
|
|
Loading…
Reference in a new issue