diff options
Diffstat (limited to 'indra/llwindow')
-rw-r--r-- | indra/llwindow/llappdelegate-objc.h | 1 | ||||
-rw-r--r-- | indra/llwindow/llopenglview-objc.mm | 5 | ||||
-rw-r--r-- | indra/llwindow/llwindowmacosx-objc.h | 2 | ||||
-rw-r--r-- | indra/llwindow/llwindowmacosx.cpp | 11 |
4 files changed, 15 insertions, 4 deletions
diff --git a/indra/llwindow/llappdelegate-objc.h b/indra/llwindow/llappdelegate-objc.h index 0b38647b4a..ceda7ff74c 100644 --- a/indra/llwindow/llappdelegate-objc.h +++ b/indra/llwindow/llappdelegate-objc.h @@ -33,6 +33,7 @@ LLNonInlineTextView *inputView; NSTimer *frameTimer; NSString *currentInputLanguage; + std::string secondLogPath; } @property (assign) IBOutlet LLNSWindow *window; diff --git a/indra/llwindow/llopenglview-objc.mm b/indra/llwindow/llopenglview-objc.mm index d2c5b11c3d..f9b387b00b 100644 --- a/indra/llwindow/llopenglview-objc.mm +++ b/indra/llwindow/llopenglview-objc.mm @@ -494,7 +494,8 @@ attributedStringInfo getSegments(NSAttributedString *str) // e.g. OS Window for upload something or Input Window... // mModifiers instance variable is for insertText: or insertText:replacementRange: (by Pell Smit) mModifiers = [theEvent modifierFlags]; - bool acceptsText = mHasMarkedText ? false : callKeyDown(&eventData, keycode, mModifiers); + + bool acceptsText = mHasMarkedText ? false : callKeyDown(&eventData, keycode, mModifiers, [[theEvent characters] characterAtIndex:0]); unichar ch; if (acceptsText && !mMarkedTextAllowed && @@ -537,7 +538,7 @@ attributedStringInfo getSegments(NSAttributedString *str) if (mModifiers & mask) { eventData.mKeyEvent = NativeKeyEventData::KEYDOWN; - callKeyDown(&eventData, [theEvent keyCode], 0); + callKeyDown(&eventData, [theEvent keyCode], 0, [[theEvent characters] characterAtIndex:0]); } else { diff --git a/indra/llwindow/llwindowmacosx-objc.h b/indra/llwindow/llwindowmacosx-objc.h index 44fd4127ce..43edc0110d 100644 --- a/indra/llwindow/llwindowmacosx-objc.h +++ b/indra/llwindow/llwindowmacosx-objc.h @@ -131,7 +131,7 @@ void setupInputWindow(NSWindowRef window, GLViewRef view); // These are all implemented in llwindowmacosx.cpp. // This is largely for easier interop between Obj-C and C++ (at least in the viewer's case due to the BOOL vs. BOOL conflict) bool callKeyUp(NSKeyEventRef event, unsigned short key, unsigned int mask); -bool callKeyDown(NSKeyEventRef event, unsigned short key, unsigned int mask); +bool callKeyDown(NSKeyEventRef event, unsigned short key, unsigned int mask, wchar_t character); void callResetKeys(); bool callUnicodeCallback(wchar_t character, unsigned int mask); void callRightMouseDown(float *pos, unsigned int mask); diff --git a/indra/llwindow/llwindowmacosx.cpp b/indra/llwindow/llwindowmacosx.cpp index 0d0607a0bb..dfdfe4aa33 100644 --- a/indra/llwindow/llwindowmacosx.cpp +++ b/indra/llwindow/llwindowmacosx.cpp @@ -208,8 +208,17 @@ bool callKeyUp(NSKeyEventRef event, unsigned short key, unsigned int mask) return retVal; } -bool callKeyDown(NSKeyEventRef event, unsigned short key, unsigned int mask) +bool callKeyDown(NSKeyEventRef event, unsigned short key, unsigned int mask, wchar_t character) { + if((key == gKeyboard->inverseTranslateKey('Z')) && (character == 'y')) + { + key = gKeyboard->inverseTranslateKey('Y'); + } + else if ((key == gKeyboard->inverseTranslateKey('Y')) && (character == 'z')) + { + key = gKeyboard->inverseTranslateKey('Z'); + } + mRawKeyEvent = event; bool retVal = gKeyboard->handleKeyDown(key, mask); mRawKeyEvent = NULL; |