From 7a053e8abf4051c597258cb99c19d22901e98fa2 Mon Sep 17 00:00:00 2001 From: Ansariel Date: Fri, 8 Jul 2011 20:19:40 +0200 Subject: [PATCH] Re-enabled "/" keystroke for starting gestures in nearby chatbar incl. properly working Shared Media prims. Fixes FIRE-1990 --- indra/llwindow/llkeyboardwin32.cpp | 5 ++++- indra/newview/llagentcamera.cpp | 7 ++++++- indra/newview/llagentcamera.h | 2 ++ indra/newview/llviewerkeyboard.cpp | 5 +++++ 4 files changed, 17 insertions(+), 2 deletions(-) diff --git a/indra/llwindow/llkeyboardwin32.cpp b/indra/llwindow/llkeyboardwin32.cpp index df78816bd6..026e33e1f4 100644 --- a/indra/llwindow/llkeyboardwin32.cpp +++ b/indra/llwindow/llkeyboardwin32.cpp @@ -74,7 +74,10 @@ LLKeyboardWin32::LLKeyboardWin32() mTranslateKeyMap[VK_OEM_COMMA] = ','; mTranslateKeyMap[VK_OEM_MINUS] = '-'; mTranslateKeyMap[VK_OEM_PERIOD] = '.'; - mTranslateKeyMap[VK_OEM_2] = '/';//This used to be KEY_PAD_DIVIDE, but that breaks typing into text fields in media prims + // Ansariel: Reverted back. This allows easy starting gestures in chat. + // Shared Media prims borkage is worked around in llviewerkeyboard.cpp, + // start_gesture( EKeystate s ) + mTranslateKeyMap[VK_OEM_2] = KEY_PAD_DIVIDE; //'/';//This used to be KEY_PAD_DIVIDE, but that breaks typing into text fields in media prims mTranslateKeyMap[VK_OEM_3] = '`'; mTranslateKeyMap[VK_OEM_4] = '['; mTranslateKeyMap[VK_OEM_5] = '\\'; diff --git a/indra/newview/llagentcamera.cpp b/indra/newview/llagentcamera.cpp index dfe53e4756..cb3d98708c 100644 --- a/indra/newview/llagentcamera.cpp +++ b/indra/newview/llagentcamera.cpp @@ -176,7 +176,9 @@ LLAgentCamera::LLAgentCamera() : mPanLeftKey(0.f), mPanRightKey(0.f), mPanInKey(0.f), - mPanOutKey(0.f) + mPanOutKey(0.f), + + mPointAtObject(NULL) { mFollowCam.setMaxCameraDistantFromSubject( MAX_CAMERA_DISTANCE_FROM_AGENT ); @@ -2769,6 +2771,9 @@ void LLAgentCamera::lookAtLastChat() BOOL LLAgentCamera::setPointAt(EPointAtType target_type, LLViewerObject *object, LLVector3 position) { + // Ansariel: Remember the current object point pointed at - we might need it later + mPointAtObject = object; + // disallow pointing at attachments and avatars //this is the editing arm motion static LLCachedControl private_pointat(gSavedSettings, "PrivatePointAtTarget", false); diff --git a/indra/newview/llagentcamera.h b/indra/newview/llagentcamera.h index 00fa6ea189..45a093160a 100644 --- a/indra/newview/llagentcamera.h +++ b/indra/newview/llagentcamera.h @@ -235,6 +235,8 @@ public: LLPointer mLookAt; LLPointer mPointAt; + LLViewerObject* mPointAtObject; + //-------------------------------------------------------------------- // Third person //-------------------------------------------------------------------- diff --git a/indra/newview/llviewerkeyboard.cpp b/indra/newview/llviewerkeyboard.cpp index 6f4f449e46..d395a70139 100644 --- a/indra/newview/llviewerkeyboard.cpp +++ b/indra/newview/llviewerkeyboard.cpp @@ -549,6 +549,11 @@ void start_chat( EKeystate s ) void start_gesture( EKeystate s ) { + // Ansariel: If avatar is pointing at something, don't start + // gesture. This works around the bug with Shared + // Media prims. + if (gAgentCamera.mPointAtObject != NULL) return; + LLUICtrl* focus_ctrlp = dynamic_cast(gFocusMgr.getKeyboardFocus()); if (KEYSTATE_UP == s && ! (focus_ctrlp && focus_ctrlp->acceptsTextInput()))