do not attempt to transale an invalid key

This commit is contained in:
michael starke
2017-01-27 10:49:03 +01:00
parent 87a783a88f
commit abf0d11348

View File

@@ -33,6 +33,9 @@ uint16_t const kMPUnknownKeyCode = UINT16_MAX;
}
+ (NSString *)stringForModifiedKey:(MPModifiedKey)modifiedKey {
if(modifiedKey.keyCode == kMPUnknownKeyCode) {
return nil;
}
TISInputSourceRef currentKeyboard = TISCopyCurrentKeyboardInputSource();
CFDataRef layoutData = TISGetInputSourceProperty(currentKeyboard,kTISPropertyUnicodeKeyLayoutData);