summaryrefslogtreecommitdiff
path: root/indra/llwindow
diff options
context:
space:
mode:
authorGeenz <geenz@geenzo.com>2013-01-02 18:53:44 -0500
committerGeenz <geenz@geenzo.com>2013-01-02 18:53:44 -0500
commit9ce3ab1a5248423eeea4d843bfb8407ed62b305e (patch)
tree038e2c3839772df1e30297eb1b58f11a62adf680 /indra/llwindow
parent966a4c893c816fc699580092bd6e93a0e514798c (diff)
Fixed the enter and return keys not being sent appropriately as unicode characters.
Diffstat (limited to 'indra/llwindow')
-rw-r--r--indra/llwindow/llkeyboardmacosx.cpp2
-rw-r--r--indra/llwindow/llopenglview-objc.mm14
-rw-r--r--indra/llwindow/llwindowmacosx-objc.h2
-rw-r--r--indra/llwindow/llwindowmacosx-objc.mm2
-rw-r--r--indra/llwindow/llwindowmacosx.cpp5
5 files changed, 20 insertions, 5 deletions
diff --git a/indra/llwindow/llkeyboardmacosx.cpp b/indra/llwindow/llkeyboardmacosx.cpp
index 3f357c600e..077ebea909 100644
--- a/indra/llwindow/llkeyboardmacosx.cpp
+++ b/indra/llwindow/llkeyboardmacosx.cpp
@@ -206,7 +206,7 @@ MASK LLKeyboardMacOSX::updateModifiers(const U32 mask)
out_mask |= MASK_SHIFT;
}
- if(mask & (MAC_CTRL_KEY | MAC_CMD_KEY))
+ if(mask & MAC_CTRL_KEY || mask & MAC_CMD_KEY)
{
out_mask |= MASK_CONTROL;
}
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]);
+ }
}
}
diff --git a/indra/llwindow/llwindowmacosx-objc.h b/indra/llwindow/llwindowmacosx-objc.h
index 655d63ac12..414491f948 100644
--- a/indra/llwindow/llwindowmacosx-objc.h
+++ b/indra/llwindow/llwindowmacosx-objc.h
@@ -93,6 +93,6 @@ void callFocus();
void callFocusLost();
NSWindowRef getMainAppWindow();
-GLViewRef getGLView(NSWindowRef window);
+GLViewRef getGLView();
unsigned int getModifiers();
diff --git a/indra/llwindow/llwindowmacosx-objc.mm b/indra/llwindow/llwindowmacosx-objc.mm
index f3972303f1..5a024eda46 100644
--- a/indra/llwindow/llwindowmacosx-objc.mm
+++ b/indra/llwindow/llwindowmacosx-objc.mm
@@ -291,7 +291,7 @@ NSWindowRef getMainAppWindow()
return winRef;
}
-GLViewRef getGLView(NSWindowRef window)
+GLViewRef getGLView()
{
return glviewRef;
}
diff --git a/indra/llwindow/llwindowmacosx.cpp b/indra/llwindow/llwindowmacosx.cpp
index cc0959edf8..902391e170 100644
--- a/indra/llwindow/llwindowmacosx.cpp
+++ b/indra/llwindow/llwindowmacosx.cpp
@@ -270,7 +270,10 @@ void callDoubleClick(float *pos, MASK mask)
void callResize(unsigned int width, unsigned int height)
{
- gWindowImplementation->getCallbacks()->handleResize(gWindowImplementation, width, height);
+ if (gWindowImplementation != NULL)
+ {
+ gWindowImplementation->getCallbacks()->handleResize(gWindowImplementation, width, height);
+ }
}
void callMouseMoved(float *pos, MASK mask)