summaryrefslogtreecommitdiff
path: root/indra/newview/llviewerkeyboard.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llviewerkeyboard.cpp')
-rwxr-xr-xindra/newview/llviewerkeyboard.cpp33
1 files changed, 21 insertions, 12 deletions
diff --git a/indra/newview/llviewerkeyboard.cpp b/indra/newview/llviewerkeyboard.cpp
index a4a05587d3..ada829eb4b 100755
--- a/indra/newview/llviewerkeyboard.cpp
+++ b/indra/newview/llviewerkeyboard.cpp
@@ -53,7 +53,6 @@ const F32 FLY_FRAMES = 4;
const F32 NUDGE_TIME = 0.25f; // in seconds
const S32 NUDGE_FRAMES = 2;
const F32 ORBIT_NUDGE_RATE = 0.05f; // fraction of normal speed
-const F32 YAW_NUDGE_RATE = 0.05f; // fraction of normal speed
struct LLKeyboardActionRegistry
: public LLRegistrySingleton<std::string, boost::function<void (EKeystate keystate)>, LLKeyboardActionRegistry>
@@ -66,7 +65,7 @@ void agent_jump( EKeystate s )
{
if( KEYSTATE_UP == s ) return;
F32 time = gKeyboard->getCurKeyElapsedTime();
- S32 frame_count = llround(gKeyboard->getCurKeyElapsedFrameCount());
+ S32 frame_count = ll_round(gKeyboard->getCurKeyElapsedFrameCount());
if( time < FLY_TIME
|| frame_count <= FLY_FRAMES
@@ -133,7 +132,7 @@ static void agent_push_forwardbackward( EKeystate s, S32 direction, LLAgent::EDo
if (KEYSTATE_UP == s) return;
F32 time = gKeyboard->getCurKeyElapsedTime();
- S32 frame_count = llround(gKeyboard->getCurKeyElapsedFrameCount());
+ S32 frame_count = ll_round(gKeyboard->getCurKeyElapsedFrameCount());
if( time < NUDGE_TIME || frame_count <= NUDGE_FRAMES)
{
@@ -149,6 +148,8 @@ void camera_move_forward( EKeystate s );
void agent_push_forward( EKeystate s )
{
+ if(gAgent.isMovementLocked()) return;
+
//in free camera control mode we need to intercept keyboard events for avatar movements
if (LLFloaterCamera::inFreeCameraMode())
{
@@ -164,6 +165,8 @@ void camera_move_backward( EKeystate s );
void agent_push_backward( EKeystate s )
{
+ if(gAgent.isMovementLocked()) return;
+
//in free camera control mode we need to intercept keyboard events for avatar movements
if (LLFloaterCamera::inFreeCameraMode())
{
@@ -184,7 +187,7 @@ static void agent_slide_leftright( EKeystate s, S32 direction, LLAgent::EDoubleT
agent_handle_doubletap_run(s, mode);
if( KEYSTATE_UP == s ) return;
F32 time = gKeyboard->getCurKeyElapsedTime();
- S32 frame_count = llround(gKeyboard->getCurKeyElapsedFrameCount());
+ S32 frame_count = ll_round(gKeyboard->getCurKeyElapsedFrameCount());
if( time < NUDGE_TIME || frame_count <= NUDGE_FRAMES)
{
@@ -199,12 +202,14 @@ static void agent_slide_leftright( EKeystate s, S32 direction, LLAgent::EDoubleT
void agent_slide_left( EKeystate s )
{
+ if(gAgent.isMovementLocked()) return;
agent_slide_leftright(s, 1, LLAgent::DOUBLETAP_SLIDELEFT);
}
void agent_slide_right( EKeystate s )
{
+ if(gAgent.isMovementLocked()) return;
agent_slide_leftright(s, -1, LLAgent::DOUBLETAP_SLIDERIGHT);
}
@@ -219,6 +224,8 @@ void agent_turn_left( EKeystate s )
return;
}
+ if(gAgent.isMovementLocked()) return;
+
if (LLToolCamera::getInstance()->mouseSteerMode())
{
agent_slide_left(s);
@@ -247,6 +254,8 @@ void agent_turn_right( EKeystate s )
return;
}
+ if(gAgent.isMovementLocked()) return;
+
if (LLToolCamera::getInstance()->mouseSteerMode())
{
agent_slide_right(s);
@@ -320,8 +329,8 @@ void camera_spin_around_cw( EKeystate s )
void camera_spin_around_ccw_sitting( EKeystate s )
{
- if( KEYSTATE_UP == s ) return;
- if (gAgent.rotateGrabbed() || gAgentCamera.sitCameraEnabled())
+ if( KEYSTATE_UP == s && gAgent.mDoubleTapRunMode != LLAgent::DOUBLETAP_SLIDERIGHT ) return;
+ if (gAgent.rotateGrabbed() || gAgentCamera.sitCameraEnabled() || gAgent.getRunning())
{
//send keystrokes, but do not change camera
agent_turn_right(s);
@@ -336,8 +345,8 @@ void camera_spin_around_ccw_sitting( EKeystate s )
void camera_spin_around_cw_sitting( EKeystate s )
{
- if( KEYSTATE_UP == s ) return;
- if (gAgent.rotateGrabbed() || gAgentCamera.sitCameraEnabled())
+ if( KEYSTATE_UP == s && gAgent.mDoubleTapRunMode != LLAgent::DOUBLETAP_SLIDELEFT ) return;
+ if (gAgent.rotateGrabbed() || gAgentCamera.sitCameraEnabled() || gAgent.getRunning())
{
//send keystrokes, but do not change camera
agent_turn_left(s);
@@ -413,8 +422,8 @@ void camera_move_backward( EKeystate s )
void camera_move_forward_sitting( EKeystate s )
{
- if( KEYSTATE_UP == s ) return;
- if (gAgent.forwardGrabbed() || gAgentCamera.sitCameraEnabled())
+ if( KEYSTATE_UP == s && gAgent.mDoubleTapRunMode != LLAgent::DOUBLETAP_FORWARD ) return;
+ if (gAgent.forwardGrabbed() || gAgentCamera.sitCameraEnabled() || gAgent.getRunning())
{
agent_push_forward(s);
}
@@ -427,9 +436,9 @@ void camera_move_forward_sitting( EKeystate s )
void camera_move_backward_sitting( EKeystate s )
{
- if( KEYSTATE_UP == s ) return;
+ if( KEYSTATE_UP == s && gAgent.mDoubleTapRunMode != LLAgent::DOUBLETAP_BACKWARD ) return;
- if (gAgent.backwardGrabbed() || gAgentCamera.sitCameraEnabled())
+ if (gAgent.backwardGrabbed() || gAgentCamera.sitCameraEnabled() || gAgent.getRunning())
{
agent_push_backward(s);
}