summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeenz <geenz@geenzo.com>2013-06-17 09:26:11 -0400
committerGeenz <geenz@geenzo.com>2013-06-17 09:26:11 -0400
commit440a1ee3bae4ea9553fa57d806f942a472923190 (patch)
tree2f46acd0d86bfe91b46e369d1bf110920936b5e8
parent93531f3ba85748ba5c9f1d797c4925f55fe8b92c (diff)
Move logic involving the input window to keyDown. Pass input events to the input window from there.
-rw-r--r--indra/llwindow/llopenglview-objc.h5
-rw-r--r--indra/llwindow/llopenglview-objc.mm9
-rw-r--r--indra/newview/llappdelegate-objc.mm2
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 <Cocoa/Cocoa.h>
#import <IOKit/IOKitLib.h>
#import <CoreFoundation/CFBase.h>
@@ -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 <Carbon/Carbon.h> // Used for Text Input Services ("Safe" API - it's well supported)
+#include <Carbon/Carbon.h> // Used for Text Input Services ("Safe" API - it's supported)
@implementation LLAppDelegate