From da90fe352847d5f27358179cb4cdf88abc40a4af Mon Sep 17 00:00:00 2001 From: Geenz Date: Tue, 15 Jan 2013 05:46:31 -0500 Subject: This *should* put an end to our modifier key woes. --- indra/llwindow/llkeyboardmacosx.cpp | 27 +- indra/llwindow/llopenglview-objc.mm | 31 +- indra/newview/SecondLife.nib | Bin 15670 -> 8541 bytes indra/newview/SecondLife.xib | 957 ++---------------------------------- 4 files changed, 68 insertions(+), 947 deletions(-) (limited to 'indra') 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 diff --git a/indra/newview/SecondLife.nib b/indra/newview/SecondLife.nib index cd69b1b812..ca89033300 100644 Binary files a/indra/newview/SecondLife.nib and b/indra/newview/SecondLife.nib differ diff --git a/indra/newview/SecondLife.xib b/indra/newview/SecondLife.xib index 212bc5830d..b4e77279fd 100644 --- a/indra/newview/SecondLife.xib +++ b/indra/newview/SecondLife.xib @@ -193,29 +193,6 @@ - - - Open Recent - - 2147483647 - - - submenuAction: - - Open Recent - - - - Clear Menu - - 2147483647 - - - - - _NSRecentDocumentsMenu - - YES @@ -235,52 +212,6 @@ - - - Save… - s - 1048576 - 2147483647 - - - - - - Revert to Saved - - 2147483647 - - - - - - YES - YES - - - 2147483647 - - - - - - Page Setup... - P - 1179648 - 2147483647 - - - - - - - Print… - p - 1048576 - 2147483647 - - - @@ -350,23 +281,6 @@ - - - Paste and Match Style - V - 1572864 - 2147483647 - - - - - - Delete - - 2147483647 - - - Select All @@ -376,303 +290,6 @@ - - - YES - YES - - - 2147483647 - - - - - - Find - - 2147483647 - - - submenuAction: - - Find - - - - Find… - f - 1048576 - 2147483647 - - - 1 - - - - Find and Replace… - f - 1572864 - 2147483647 - - - 12 - - - - Find Next - g - 1048576 - 2147483647 - - - 2 - - - - Find Previous - G - 1048576 - 2147483647 - - - 3 - - - - Use Selection for Find - e - 1048576 - 2147483647 - - - 7 - - - - Jump to Selection - j - 1048576 - 2147483647 - - - - - - - - - Spelling and Grammar - - 2147483647 - - - submenuAction: - - Spelling - - - - Show Spelling and Grammar - : - 1048576 - 2147483647 - - - - - - Check Document Now - ; - 1048576 - 2147483647 - - - - - - YES - YES - - - 2147483647 - - - - - - Check Spelling While Typing - - 2147483647 - - - - - - Check Grammar With Spelling - - 2147483647 - - - - - - Correct Spelling Automatically - - 2147483647 - - - - - - - - - Substitutions - - 2147483647 - - - submenuAction: - - Substitutions - - - - Show Substitutions - - 2147483647 - - - - - - YES - YES - - - 2147483647 - - - - - - Smart Copy/Paste - - 2147483647 - - - - - - Smart Quotes - - 2147483647 - - - - - - Smart Dashes - - 2147483647 - - - - - - Smart Links - - 2147483647 - - - - - - Data Detectors - - 2147483647 - - - - - - Text Replacement - - 2147483647 - - - - - - - - - Transformations - - 2147483647 - - - submenuAction: - - Transformations - - - - Make Upper Case - - 2147483647 - - - - - - Make Lower Case - - 2147483647 - - - - - - Capitalize - - 2147483647 - - - - - - - - - Speech - - 2147483647 - - - submenuAction: - - Speech - - - - Start Speaking - - 2147483647 - - - - - - Stop Speaking - - 2147483647 - - - - - - @@ -776,13 +393,10 @@ {1024, 768} - + 256 {1024, 768} - - - _NS:20 {{0, 0}, {1920, 1178}} @@ -834,30 +448,6 @@ 39 - - - print: - - - - 86 - - - - runPageLayout: - - - - 87 - - - - clearRecentDocuments: - - - - 127 - performClose: @@ -882,22 +472,6 @@ 360 - - - saveDocument: - - - - 362 - - - - revertDocumentToSaved: - - - - 364 - hide: @@ -938,38 +512,6 @@ 769 - - - toggleSmartInsertDelete: - - - - 770 - - - - toggleAutomaticDashSubstitution: - - - - 773 - - - - toggleContinuousSpellChecking: - - - - 774 - - - - toggleAutomaticDataDetection: - - - - 775 - undo: @@ -978,30 +520,6 @@ 776 - - - startSpeaking: - - - - 778 - - - - showGuessPanel: - - - - 779 - - - - checkSpelling: - - - - 780 - copy: @@ -1010,14 +528,6 @@ 782 - - - delete: - - - - 783 - selectAll: @@ -1026,38 +536,6 @@ 785 - - - stopSpeaking: - - - - 786 - - - - orderFrontSubstitutionsPanel: - - - - 787 - - - - toggleAutomaticTextReplacement: - - - - 788 - - - - toggleAutomaticSpellingCorrection: - - - - 790 - toggleFullScreen: @@ -1150,85 +628,18 @@ 81 - - - - - - - - 75 - - - - - 78 - - - - - 72 - - - - - 82 - - - - - 124 - - - - - - - - 77 - - - 73 - - 79 - - - - - 112 - - - - - 74 - - - - - 125 - - - - - - - - 126 - - - 106 @@ -1373,33 +784,10 @@ - - - - - - - - - - 713 - - - - - 714 - - - - - 715 - - - 716 @@ -1415,251 +803,11 @@ - - 719 - - - - - 720 - - - 721 - - 722 - - - - - 723 - - - - - - - - 724 - - - - - - - - 725 - - - - - - - - 726 - - - - - - - - 727 - - - - - - - - 738 - - - - - - - - - 739 - - - - - 740 - - - - - 741 - - - - - - - - - - 742 - - - - - 743 - - - - - 744 - - - - - 745 - - - - - - - - - - - - - - - 746 - - - - - 747 - - - - - 748 - - - - - 749 - - - - - 750 - - - - - 751 - - - - - 752 - - - - - 753 - - - - - 754 - - - - - - - - - - - - - 755 - - - - - 756 - - - - - 757 - - - - - 758 - - - - - 759 - - - - - 760 - - - - - 761 - - - - - - - - - - - - - 762 - - - - - 763 - - - - - 764 - - - - - 765 - - - - - 766 - - - - - 821 - - - 824 @@ -1684,6 +832,36 @@ + + 713 + + + + + 714 + + + + + 715 + + + + + 82 + + + + + 79 + + + + + 72 + + + @@ -1693,10 +871,6 @@ com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -1725,54 +899,12 @@ com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -1794,20 +926,17 @@ LLAppDelegate NSObject - - LLOpenGLView - LLNSWindow - - - - glview - LLOpenGLView - - + + window + LLNSWindow + + + window + window LLNSWindow - + IBProjectSource ./Classes/LLAppDelegate.h @@ -1821,14 +950,6 @@ ./Classes/LLNSWindow.h - - LLOpenGLView - NSOpenGLView - - IBProjectSource - ./Classes/LLOpenGLView.h - - 0 -- cgit v1.2.3