From 440a1ee3bae4ea9553fa57d806f942a472923190 Mon Sep 17 00:00:00 2001 From: Geenz Date: Mon, 17 Jun 2013 09:26:11 -0400 Subject: Move logic involving the input window to keyDown. Pass input events to the input window from there. --- indra/llwindow/llopenglview-objc.h | 5 +++++ indra/llwindow/llopenglview-objc.mm | 9 +++++++-- indra/newview/llappdelegate-objc.mm | 2 +- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/indra/llwindow/llopenglview-objc.h b/indra/llwindow/llopenglview-objc.h index 5309dea664..d4207d598a 100644 --- a/indra/llwindow/llopenglview-objc.h +++ b/indra/llwindow/llopenglview-objc.h @@ -6,6 +6,9 @@ // // +#ifndef LLOpenGLView_H +#define LLOpenGLView_H + #import #import #import @@ -85,3 +88,5 @@ - (NSPoint)flipPoint:(NSPoint)aPoint; @end + +#endif \ No newline at end of file diff --git a/indra/llwindow/llopenglview-objc.mm b/indra/llwindow/llopenglview-objc.mm index 062577baf8..99c27e79a0 100644 --- a/indra/llwindow/llopenglview-objc.mm +++ b/indra/llwindow/llopenglview-objc.mm @@ -8,6 +8,7 @@ #import "llopenglview-objc.h" #include "llwindowmacosx-objc.h" +#import "llappdelegate-objc.h" @implementation NSScreen (PointConversion) @@ -318,6 +319,11 @@ attributedStringInfo getSegments(NSAttributedString *str) uint keycode = [theEvent keyCode]; if (callKeyDown(keycode, mModifiers)) { + if (!mMarkedTextAllowed && [[theEvent characters] characterAtIndex:0] != NSBackspaceCharacter) + { + showInputWindow(true, @""); + [[[(LLAppDelegate*)[NSApp delegate] inputView] inputContext] handleEvent:theEvent]; + } [[self inputContext] handleEvent:theEvent]; } // OS X intentionally does not send us key-up information on cmd-key combinations. @@ -426,8 +432,7 @@ attributedStringInfo getSegments(NSAttributedString *str) mHasMarkedText = TRUE; mMarkedTextLength = [aString length]; mMarkedText = (NSAttributedString*)[aString mutableString]; - } else if ([[aString mutableString] characterAtIndex:0] != NSBackspaceCharacter) { - showInputWindow(true, aString); + } else { if (mHasMarkedText) { [self unmarkText]; diff --git a/indra/newview/llappdelegate-objc.mm b/indra/newview/llappdelegate-objc.mm index b4f9c56b00..403c307085 100644 --- a/indra/newview/llappdelegate-objc.mm +++ b/indra/newview/llappdelegate-objc.mm @@ -8,7 +8,7 @@ #import "llappdelegate-objc.h" #include "llwindowmacosx-objc.h" -#include // Used for Text Input Services ("Safe" API - it's well supported) +#include // Used for Text Input Services ("Safe" API - it's supported) @implementation LLAppDelegate -- cgit v1.2.3