summaryrefslogtreecommitdiff
path: root/indra/llwindow/llopenglview-objc.mm
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llwindow/llopenglview-objc.mm')
-rw-r--r--indra/llwindow/llopenglview-objc.mm14
1 files changed, 13 insertions, 1 deletions
diff --git a/indra/llwindow/llopenglview-objc.mm b/indra/llwindow/llopenglview-objc.mm
index cb8d7b315f..e5e198b856 100644
--- a/indra/llwindow/llopenglview-objc.mm
+++ b/indra/llwindow/llopenglview-objc.mm
@@ -30,6 +30,11 @@
[super dealloc];
}
+- (id) init
+{
+ return [self initWithFrame:[self bounds] withSamples:2 andVsync:TRUE];
+}
+
- (id) initWithFrame:(NSRect)frame withSamples:(NSUInteger)samples andVsync:(BOOL)vsync
{
@@ -205,7 +210,14 @@
NSString *chars = [theEvent characters];
for (uint i = 0; i < [chars length]; i++)
{
- callUnicodeCallback([chars characterAtIndex:i], [theEvent modifierFlags]);
+ // Enter and Return are special cases.
+ unichar returntest = [chars characterAtIndex:i];
+ if ((returntest == NSCarriageReturnCharacter || returntest == NSEnterCharacter) && !([theEvent modifierFlags] & NSCommandKeyMask) && !([theEvent modifierFlags] & NSAlternateKeyMask) && !([theEvent modifierFlags] & NSControlKeyMask))
+ {
+ callUnicodeCallback(returntest, 0);
+ } else {
+ callUnicodeCallback([chars characterAtIndex:i], [theEvent modifierFlags]);
+ }
}
}