diff options
author | Pell Smit <pellsmit@gmail.com> | 2014-08-15 03:52:22 +0900 |
---|---|---|
committer | Pell Smit <pellsmit@gmail.com> | 2014-08-15 03:52:22 +0900 |
commit | ebd94bf07a02beee8fbf84ec172bcbf1ac3d475f (patch) | |
tree | 682496d7a8ad4aaa97d27a4c714ea87802bf475c /indra/llwindow | |
parent | bef17f2af78c9f351ecbe80740ae71a61985d06e (diff) |
fixed: unwanted input window on OSX
Diffstat (limited to 'indra/llwindow')
-rw-r--r-- | indra/llwindow/llopenglview-objc.mm | 11 | ||||
-rwxr-xr-x | indra/llwindow/llwindowmacosx.cpp | 3 |
2 files changed, 6 insertions, 8 deletions
diff --git a/indra/llwindow/llopenglview-objc.mm b/indra/llwindow/llopenglview-objc.mm index 76eefbf5b1..7b562e3382 100644 --- a/indra/llwindow/llopenglview-objc.mm +++ b/indra/llwindow/llopenglview-objc.mm @@ -379,15 +379,14 @@ attributedStringInfo getSegments(NSAttributedString *str) // mModifiers instance variable is for insertText: or insertText:replacementRange: (by Pell Smit) mModifiers = [theEvent modifierFlags]; bool acceptsText = mHasMarkedText ? false : callKeyDown(keycode, mModifiers); + unichar ch; if (acceptsText && !mMarkedTextAllowed && + !(mModifiers & (NSControlKeyMask | NSCommandKeyMask)) && // commands don't invoke InputWindow ![(LLAppDelegate*)[NSApp delegate] romanScript] && - [[theEvent charactersIgnoringModifiers] characterAtIndex:0] != NSDeleteCharacter && - [[theEvent charactersIgnoringModifiers] characterAtIndex:0] != NSBackspaceCharacter && - [[theEvent charactersIgnoringModifiers] characterAtIndex:0] != NSDownArrowFunctionKey && - [[theEvent charactersIgnoringModifiers] characterAtIndex:0] != NSUpArrowFunctionKey && - [[theEvent charactersIgnoringModifiers] characterAtIndex:0] != NSLeftArrowFunctionKey && - [[theEvent charactersIgnoringModifiers] characterAtIndex:0] != NSRightArrowFunctionKey) + (ch = [[theEvent charactersIgnoringModifiers] characterAtIndex:0]) > ' ' && + ch != NSDeleteCharacter && + (ch < 0xF700 || ch > 0xF8FF)) // 0xF700-0xF8FF: reserved for function keys on the keyboard(from NSEvent.h) { [(LLAppDelegate*)[NSApp delegate] showInputWindow:true withEvent:theEvent]; } else diff --git a/indra/llwindow/llwindowmacosx.cpp b/indra/llwindow/llwindowmacosx.cpp index 18d5152015..75900c3cb4 100755 --- a/indra/llwindow/llwindowmacosx.cpp +++ b/indra/llwindow/llwindowmacosx.cpp @@ -1805,8 +1805,6 @@ static long getDictLong (CFDictionaryRef refDict, CFStringRef key) void LLWindowMacOSX::allowLanguageTextInput(LLPreeditor *preeditor, BOOL b) { - allowDirectMarkedTextInput(b, mGLView); - if (preeditor != mPreeditor && !b) { // This condition may occur by a call to @@ -1836,6 +1834,7 @@ void LLWindowMacOSX::allowLanguageTextInput(LLPreeditor *preeditor, BOOL b) return; } mLanguageTextInputAllowed = b; + allowDirectMarkedTextInput(b, mGLView); // mLanguageTextInputAllowed and mMarkedTextAllowed should be updated at once (by Pell Smit } void LLWindowMacOSX::interruptLanguageTextInput() |