diff options
Diffstat (limited to 'indra/newview/llappdelegate-objc.mm')
-rw-r--r-- | indra/newview/llappdelegate-objc.mm | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/indra/newview/llappdelegate-objc.mm b/indra/newview/llappdelegate-objc.mm index cec9c586e6..6b7e613491 100644 --- a/indra/newview/llappdelegate-objc.mm +++ b/indra/newview/llappdelegate-objc.mm @@ -73,11 +73,7 @@ - (void) showInputWindow:(bool)show withEvent:(NSEvent*)textEvent { - // How to add support for new languages with the input window: - // Simply append this array with the language code (ja for japanese, ko for korean, zh for chinese, etc.) - NSArray *authorizedLanguages = [[NSArray alloc] initWithObjects:@"ja", @"ko", @"zh-Hant", @"zh-Hans", nil]; - - if ([authorizedLanguages containsObject:currentInputLanguage]) + if (![self romanScript]) { if (show) { @@ -85,6 +81,7 @@ [inputWindow makeKeyAndOrderFront:inputWindow]; if (textEvent != nil) { + [[inputView inputContext] discardMarkedText]; [[inputView inputContext] handleEvent:textEvent]; } } else { @@ -105,7 +102,7 @@ TISInputSourceRef currentInput = TISCopyCurrentKeyboardInputSource(); CFArrayRef languages = (CFArrayRef)TISGetInputSourceProperty(currentInput, kTISPropertyInputSourceLanguages); -#if 1 // In the event of ever needing to add new language sources, change this to 1 and watch the terminal for "languages:" +#if 0 // In the event of ever needing to add new language sources, change this to 1 and watch the terminal for "languages:" NSLog(@"languages: %@", TISGetInputSourceProperty(currentInput, kTISPropertyInputSourceLanguages)); #endif @@ -113,4 +110,17 @@ currentInputLanguage = (NSString*)CFArrayGetValueAtIndex(languages, 0); } +- (bool) romanScript +{ + // How to add support for new languages with the input window: + // Simply append this array with the language code (ja for japanese, ko for korean, zh for chinese, etc.) + NSArray *nonRomanScript = [[NSArray alloc] initWithObjects:@"ja", @"ko", @"zh-Hant", @"zh-Hans", nil]; + if ([nonRomanScript containsObject:currentInputLanguage]) + { + return false; + } + + return true; +} + @end |