summaryrefslogtreecommitdiff
path: root/indra/newview/llviewerkeyboard.cpp
diff options
context:
space:
mode:
authorAura Linden <aura@lindenlab.com>2014-09-18 17:00:23 -0700
committerAura Linden <aura@lindenlab.com>2014-09-18 17:00:23 -0700
commit951c83724d7e364ac52cbee2d657711fda7d2c26 (patch)
tree20b95debd0a3bb52f32df0db52d6dc91caf5793f /indra/newview/llviewerkeyboard.cpp
parent78304e398fa7d4604eac98247173b33d712ec135 (diff)
parent61fb8c3fe31c73ce9121daac545aa7c8fc79ec8c (diff)
Merged in viewer-tiger
Diffstat (limited to 'indra/newview/llviewerkeyboard.cpp')
-rwxr-xr-xindra/newview/llviewerkeyboard.cpp39
1 files changed, 28 insertions, 11 deletions
diff --git a/indra/newview/llviewerkeyboard.cpp b/indra/newview/llviewerkeyboard.cpp
index 160478788c..a4a05587d3 100755
--- a/indra/newview/llviewerkeyboard.cpp
+++ b/indra/newview/llviewerkeyboard.cpp
@@ -88,18 +88,25 @@ void agent_push_down( EKeystate s )
gAgent.moveUp(-1);
}
+static void agent_check_temporary_run(LLAgent::EDoubleTapRunMode mode)
+{
+ if (gAgent.mDoubleTapRunMode == mode &&
+ gAgent.getRunning() &&
+ !gAgent.getAlwaysRun())
+ {
+ // Turn off temporary running.
+ gAgent.clearRunning();
+ gAgent.sendWalkRun(gAgent.getRunning());
+ }
+}
+
static void agent_handle_doubletap_run(EKeystate s, LLAgent::EDoubleTapRunMode mode)
{
if (KEYSTATE_UP == s)
{
- if (gAgent.mDoubleTapRunMode == mode &&
- gAgent.getRunning() &&
- !gAgent.getAlwaysRun())
- {
- // Turn off temporary running.
- gAgent.clearRunning();
- gAgent.sendWalkRun(gAgent.getRunning());
- }
+ // Note: in case shift is already released, slide left/right run
+ // will be released in agent_turn_left()/agent_turn_right()
+ agent_check_temporary_run(mode);
}
else if (gSavedSettings.getBOOL("AllowTapTapHoldRun") &&
KEYSTATE_DOWN == s &&
@@ -162,7 +169,7 @@ void agent_push_backward( EKeystate s )
{
camera_move_backward(s);
}
- else if (!gAgent.backwardGrabbed() && gAgentAvatarp->isSitting())
+ else if (!gAgent.backwardGrabbed() && gAgentAvatarp->isSitting() && gSavedSettings.getBOOL("LeaveMouselook"))
{
gAgentCamera.changeCameraToThirdPerson();
}
@@ -218,7 +225,12 @@ void agent_turn_left( EKeystate s )
}
else
{
- if (KEYSTATE_UP == s) return;
+ if (KEYSTATE_UP == s)
+ {
+ // Check temporary running. In case user released 'left' key with shift already released.
+ agent_check_temporary_run(LLAgent::DOUBLETAP_SLIDELEFT);
+ return;
+ }
F32 time = gKeyboard->getCurKeyElapsedTime();
gAgent.moveYaw( LLFloaterMove::getYawRate( time ) );
}
@@ -241,7 +253,12 @@ void agent_turn_right( EKeystate s )
}
else
{
- if (KEYSTATE_UP == s) return;
+ if (KEYSTATE_UP == s)
+ {
+ // Check temporary running. In case user released 'right' key with shift already released.
+ agent_check_temporary_run(LLAgent::DOUBLETAP_SLIDERIGHT);
+ return;
+ }
F32 time = gKeyboard->getCurKeyElapsedTime();
gAgent.moveYaw( -LLFloaterMove::getYawRate( time ) );
}