summaryrefslogtreecommitdiff
path: root/indra/llwindow
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llwindow')
-rw-r--r--indra/llwindow/llkeyboardmacosx.cpp27
-rw-r--r--indra/llwindow/llopenglview-objc.mm31
2 files changed, 29 insertions, 29 deletions
diff --git a/indra/llwindow/llkeyboardmacosx.cpp b/indra/llwindow/llkeyboardmacosx.cpp
index 3db94e8835..59cc2acaec 100644
--- a/indra/llwindow/llkeyboardmacosx.cpp
+++ b/indra/llwindow/llkeyboardmacosx.cpp
@@ -200,9 +200,25 @@ static BOOL translateKeyMac(const U16 key, const U32 mask, KEY &outKey, U32 &out
MASK LLKeyboardMacOSX::updateModifiers(const U32 mask)
{
- // This is handled for us in LLNSWindow on OS X.
-
- return mask;
+ // translate the mask
+ MASK out_mask = 0;
+
+ if(mask & MAC_SHIFT_KEY)
+ {
+ out_mask |= MASK_SHIFT;
+ }
+
+ if(mask & MAC_CTRL_KEY || mask & MAC_CMD_KEY)
+ {
+ out_mask |= MASK_CONTROL;
+ }
+
+ if(mask & MAC_ALT_KEY)
+ {
+ out_mask |= MASK_ALT;
+ }
+
+ return out_mask;
}
BOOL LLKeyboardMacOSX::handleKeyDown(const U16 key, const U32 mask)
@@ -232,6 +248,7 @@ BOOL LLKeyboardMacOSX::handleKeyUp(const U16 key, const U32 mask)
if(translateNumpadKey(key, &translated_key))
{
+ LL_INFOS("Keyboard") << "Handled key!" << LL_ENDL;
handled = handleTranslatedKeyUp(translated_key, translated_mask);
}
@@ -252,8 +269,8 @@ MASK LLKeyboardMacOSX::currentMask(BOOL for_mouse_event)
{
if (mask & MAC_CMD_KEY) result |= MASK_CONTROL;
}
-
- return mask;
+
+ return result;
}
void LLKeyboardMacOSX::scanKeyboard()
diff --git a/indra/llwindow/llopenglview-objc.mm b/indra/llwindow/llopenglview-objc.mm
index d91601152b..25669b25d3 100644
--- a/indra/llwindow/llopenglview-objc.mm
+++ b/indra/llwindow/llopenglview-objc.mm
@@ -190,6 +190,11 @@
[_window flagsChanged:theEvent];
}
+- (void) mouseExited:(NSEvent *)theEvent
+{
+ [_window mouseExited:theEvent];
+}
+
- (BOOL) becomeFirstResponder
{
return [_window becomeFirstResponder];
@@ -217,6 +222,7 @@
- (void) keyDown:(NSEvent *)theEvent
{
callKeyDown([theEvent keyCode], mModifiers);
+ NSLog(@"Keycode: %hu", [theEvent keyCode]);
NSString *chars = [theEvent characters];
for (uint i = 0; i < [chars length]; i++)
{
@@ -254,30 +260,7 @@
}
- (void)flagsChanged:(NSEvent *)theEvent {
- uint modifiers = [theEvent modifierFlags];
-
- // Filter through our modifier keys, and only pick out the ones we care about.
-
- mModifiers = 0;
- if (modifiers & NSCommandKeyMask)
- {
- mModifiers |= 0x0001;
- }
-
- if (modifiers & NSAlternateKeyMask)
- {
- mModifiers |= 0x0002;
- }
-
- if (modifiers & NSShiftKeyMask)
- {
- mModifiers |= 0x0004;
- }
-
- if (modifiers & NSControlKeyMask)
- {
- mModifiers |= 0x0001;
- }
+ mModifiers = [theEvent modifierFlags];
}
- (void) mouseDown:(NSEvent *)theEvent