Move logic involving the input window to keyDown. Pass input events to the input window from there.

master
Geenz 2013-06-17 09:26:11 -04:00
parent 93531f3ba8
commit 440a1ee3ba
3 changed files with 13 additions and 3 deletions

View File

@ -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

View File

@ -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];

View File

@ -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