equal
deleted
inserted
replaced
380 |
380 |
381 static unichar NsGetDeadKeyChar(unsigned short keyCode) |
381 static unichar NsGetDeadKeyChar(unsigned short keyCode) |
382 { |
382 { |
383 TISInputSourceRef currentKeyboard = TISCopyCurrentKeyboardInputSource(); |
383 TISInputSourceRef currentKeyboard = TISCopyCurrentKeyboardInputSource(); |
384 CFDataRef uchr = (CFDataRef)TISGetInputSourceProperty(currentKeyboard, kTISPropertyUnicodeKeyLayoutData); |
384 CFDataRef uchr = (CFDataRef)TISGetInputSourceProperty(currentKeyboard, kTISPropertyUnicodeKeyLayoutData); |
385 if (uchr == nil) { return; } |
385 if (uchr == nil) { return 0; } |
386 const UCKeyboardLayout *keyboardLayout = (const UCKeyboardLayout*)CFDataGetBytePtr(uchr); |
386 const UCKeyboardLayout *keyboardLayout = (const UCKeyboardLayout*)CFDataGetBytePtr(uchr); |
387 // Carbon modifiers should be used instead of NSEvent modifiers |
387 // Carbon modifiers should be used instead of NSEvent modifiers |
388 UInt32 modifierKeyState = (GetCurrentEventKeyModifiers() >> 8) & 0xFF; |
388 UInt32 modifierKeyState = (GetCurrentEventKeyModifiers() >> 8) & 0xFF; |
389 |
389 |
390 if (keyboardLayout) { |
390 if (keyboardLayout) { |