From 860b86e3d1c61c18be99301ea1c5027058a8353d Mon Sep 17 00:00:00 2001 From: Geenz Date: Thu, 27 Jun 2013 13:48:44 -0400 Subject: Fix for down key presses not opening up the IME character selection window, and inadvertently being handled while marked text is selected. --- indra/llwindow/llopenglview-objc.mm | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/indra/llwindow/llopenglview-objc.mm b/indra/llwindow/llopenglview-objc.mm index aa7df2c985..7803d78862 100644 --- a/indra/llwindow/llopenglview-objc.mm +++ b/indra/llwindow/llopenglview-objc.mm @@ -316,12 +316,16 @@ attributedStringInfo getSegments(NSAttributedString *str) - (void) keyDown:(NSEvent *)theEvent { uint keycode = [theEvent keyCode]; - bool acceptsText = callKeyDown(keycode, mModifiers); + bool acceptsText = mHasMarkedText ? false : callKeyDown(keycode, mModifiers); if (acceptsText && !mMarkedTextAllowed && ![(LLAppDelegate*)[NSApp delegate] romanScript] && [[theEvent charactersIgnoringModifiers] characterAtIndex:0] != NSDeleteCharacter && - [[theEvent charactersIgnoringModifiers] characterAtIndex:0] != NSBackspaceCharacter) + [[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) { [(LLAppDelegate*)[NSApp delegate] showInputWindow:true withEvent:theEvent]; } else @@ -339,7 +343,7 @@ attributedStringInfo getSegments(NSAttributedString *str) // OS X intentionally does not send us key-up information on cmd-key combinations. // This behaviour is not a bug, and only applies to cmd-combinations (no others). // Since SL assumes we receive those, we fake it here. - if (mModifiers & NSCommandKeyMask) + if (mModifiers & NSCommandKeyMask && !mHasMarkedText) { callKeyUp([theEvent keyCode], mModifiers); } -- cgit v1.2.3