summaryrefslogtreecommitdiff
path: root/indra/newview/llviewerinput.cpp
diff options
context:
space:
mode:
authorandreykproductengine <andreykproductengine@lindenlab.com>2019-09-27 19:53:33 +0300
committerAndrey Kleshchev <andreykproductengine@lindenlab.com>2020-06-23 14:48:04 +0300
commit0b8021870335ff9b9684fb193c6e0fe2f02b4091 (patch)
tree418c417b7ee2f7602d78d6a2b084e0f78b77914c /indra/newview/llviewerinput.cpp
parentb12cf6696348520556cf70f96e0562776479fe70 (diff)
SL-6109 Cleanup, run commands, and preparation for tooltip support
Diffstat (limited to 'indra/newview/llviewerinput.cpp')
-rw-r--r--indra/newview/llviewerinput.cpp76
1 files changed, 76 insertions, 0 deletions
diff --git a/indra/newview/llviewerinput.cpp b/indra/newview/llviewerinput.cpp
index fb405fd225..4a06a2012f 100644
--- a/indra/newview/llviewerinput.cpp
+++ b/indra/newview/llviewerinput.cpp
@@ -650,6 +650,78 @@ bool start_gesture( EKeystate s )
return true;
}
+bool run_forward(EKeystate s)
+{
+ if (KEYSTATE_DOWN == s)
+ {
+ gAgent.setAlwaysRun();
+ gAgent.setRunning();
+ gAgent.sendWalkRun(true);
+ }
+ else if(KEYSTATE_UP == s)
+ {
+ gAgent.clearAlwaysRun();
+ gAgent.clearRunning();
+ gAgent.sendWalkRun(false);
+ }
+ agent_push_forward(s);
+ return true;
+}
+
+bool run_backward(EKeystate s)
+{
+ if (KEYSTATE_DOWN == s)
+ {
+ gAgent.setAlwaysRun();
+ gAgent.setRunning();
+ gAgent.sendWalkRun(true);
+ }
+ else if (KEYSTATE_UP == s)
+ {
+ gAgent.clearAlwaysRun();
+ gAgent.clearRunning();
+ gAgent.sendWalkRun(false);
+ }
+ agent_push_backward(s);
+ return true;
+}
+
+bool run_left(EKeystate s)
+{
+ if (KEYSTATE_DOWN == s)
+ {
+ gAgent.setAlwaysRun();
+ gAgent.setRunning();
+ gAgent.sendWalkRun(true);
+ }
+ else if (KEYSTATE_UP == s)
+ {
+ gAgent.clearAlwaysRun();
+ gAgent.clearRunning();
+ gAgent.sendWalkRun(false);
+ }
+ agent_slide_left(s);
+ return true;
+}
+
+bool run_right(EKeystate s)
+{
+ if (KEYSTATE_DOWN == s)
+ {
+ gAgent.setAlwaysRun();
+ gAgent.setRunning();
+ gAgent.sendWalkRun(true);
+ }
+ else if (KEYSTATE_UP == s)
+ {
+ gAgent.clearAlwaysRun();
+ gAgent.clearRunning();
+ gAgent.sendWalkRun(false);
+ }
+ agent_slide_right(s);
+ return true;
+}
+
bool toggle_run(EKeystate s)
{
if (KEYSTATE_DOWN != s) return true;
@@ -791,6 +863,10 @@ REGISTER_KEYBOARD_ACTION("edit_avatar_move_backward", edit_avatar_move_backward)
REGISTER_KEYBOARD_ACTION("stop_moving", stop_moving);
REGISTER_KEYBOARD_ACTION("start_chat", start_chat);
REGISTER_KEYBOARD_ACTION("start_gesture", start_gesture);
+REGISTER_KEYBOARD_ACTION("run_forward", run_forward);
+REGISTER_KEYBOARD_ACTION("run_backward", run_backward);
+REGISTER_KEYBOARD_ACTION("run_left", run_left);
+REGISTER_KEYBOARD_ACTION("run_right", run_right);
REGISTER_KEYBOARD_ACTION("toggle_run", toggle_run);
REGISTER_KEYBOARD_ACTION("toggle_sit", toggle_sit);
REGISTER_KEYBOARD_ACTION("toggle_pause_media", toggle_pause_media);