summaryrefslogtreecommitdiff
path: root/indra/newview/llviewerkeyboard.cpp
diff options
context:
space:
mode:
authorBrad Payne (Vir Linden) <vir@lindenlab.com>2014-12-22 15:02:25 -0500
committerBrad Payne (Vir Linden) <vir@lindenlab.com>2014-12-22 15:02:25 -0500
commit655c2bd33757ce7ad5da2772f2cae8785898cbdb (patch)
tree319ef56eab5b71af7ce5e94ab6f16b739d83edb8 /indra/newview/llviewerkeyboard.cpp
parent87a033d3bf1af2b3cba1047b720e7d93f535dc46 (diff)
parent79a89f5d921f99ba7a990a1dbf7428d1d3758bc6 (diff)
merge
Diffstat (limited to 'indra/newview/llviewerkeyboard.cpp')
-rwxr-xr-xindra/newview/llviewerkeyboard.cpp37
1 files changed, 27 insertions, 10 deletions
diff --git a/indra/newview/llviewerkeyboard.cpp b/indra/newview/llviewerkeyboard.cpp
index b0f4802e20..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 &&
@@ -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 ) );
}