llviewerkeyboard.cpp File Reference

LLViewerKeyboard class implementation. More...

#include "llviewerprecompiledheaders.h"
#include "llviewerkeyboard.h"
#include "llmath.h"
#include "llagent.h"
#include "llchatbar.h"
#include "llviewercontrol.h"
#include "llfocusmgr.h"
#include "llmorphview.h"
#include "llmoveview.h"
#include "lltoolfocus.h"
#include "llviewerwindow.h"
#include "llvoavatar.h"

Include dependency graph for llviewerkeyboard.cpp:

Go to the source code of this file.

Functions

void agent_jump (EKeystate s)
void agent_push_down (EKeystate s)
void agent_push_forward (EKeystate s)
void agent_push_backward (EKeystate s)
void agent_slide_left (EKeystate s)
void agent_slide_right (EKeystate s)
void agent_turn_left (EKeystate s)
void agent_turn_right (EKeystate s)
void agent_look_up (EKeystate s)
void agent_look_down (EKeystate s)
void agent_toggle_fly (EKeystate s)
F32 get_orbit_rate ()
void camera_spin_around_ccw (EKeystate s)
void camera_spin_around_cw (EKeystate s)
void camera_spin_around_ccw_sitting (EKeystate s)
void camera_spin_around_cw_sitting (EKeystate s)
void camera_spin_over (EKeystate s)
void camera_spin_under (EKeystate s)
void camera_spin_over_sitting (EKeystate s)
void camera_spin_under_sitting (EKeystate s)
void camera_move_forward (EKeystate s)
void camera_move_backward (EKeystate s)
void camera_move_forward_sitting (EKeystate s)
void camera_move_backward_sitting (EKeystate s)
void camera_pan_up (EKeystate s)
void camera_pan_down (EKeystate s)
void camera_pan_left (EKeystate s)
void camera_pan_right (EKeystate s)
void camera_pan_in (EKeystate s)
void camera_pan_out (EKeystate s)
void camera_move_forward_fast (EKeystate s)
void camera_move_backward_fast (EKeystate s)
void edit_avatar_spin_ccw (EKeystate s)
void edit_avatar_spin_cw (EKeystate s)
void edit_avatar_spin_over (EKeystate s)
void edit_avatar_spin_under (EKeystate s)
void edit_avatar_move_forward (EKeystate s)
void edit_avatar_move_backward (EKeystate s)
void stop_moving (EKeystate s)
void start_chat (EKeystate s)
void bind_keyboard_functions ()

Variables

const F32 FLY_TIME = 0.5f
const F32 FLY_FRAMES = 4
const F32 NUDGE_TIME = 0.25f
const S32 NUDGE_FRAMES = 2
const F32 ORBIT_NUDGE_RATE = 0.05f
const F32 YAW_NUDGE_RATE = 0.05f
LLViewerKeyboard gViewerKeyboard


Detailed Description

LLViewerKeyboard class implementation.

LicenseInfo
firstyear=2005&license=viewergpl

Copyright (c) 2005-2007, Linden Research, Inc.

Second Life Viewer Source Code The source code in this file ("Source Code") is provided by Linden Lab to you under the terms of the GNU General Public License, version 2.0 ("GPL"), unless you have obtained a separate licensing agreement ("Other License"), formally executed by you and Linden Lab. Terms of the GPL can be found in doc/GPL-license.txt in this distribution, or online at http://secondlife.com/developers/opensource/gplv2

There are special exceptions to the terms and conditions of the GPL as it is applied to this Source Code. View the full text of the exception in the file doc/FLOSS-exception.txt in this software distribution, or online at http://secondlife.com/developers/opensource/flossexception

By copying, modifying or distributing this software, you acknowledge that you have read and understood your obligations described above, and agree to abide by those obligations.

ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, COMPLETENESS OR PERFORMANCE. $/LicenseInfo$

Definition in file llviewerkeyboard.cpp.


Function Documentation

void agent_jump ( EKeystate  s  ) 

Definition at line 60 of file llviewerkeyboard.cpp.

References FLY_FRAMES, FLY_TIME, gAgent, LLControlGroup::getBOOL(), LLKeyboard::getCurKeyElapsedFrameCount(), LLKeyboard::getCurKeyElapsedTime(), gKeyboard, gSavedSettings, KEYSTATE_UP, llround(), LLAgent::moveUp(), S32, LLAgent::setFlying(), TRUE, and LLAgent::upGrabbed().

Referenced by bind_keyboard_functions(), and camera_spin_over_sitting().

void agent_look_down ( EKeystate  s  ) 

Definition at line 189 of file llviewerkeyboard.cpp.

References gAgent, KEYSTATE_UP, and LLAgent::movePitch().

Referenced by bind_keyboard_functions().

void agent_look_up ( EKeystate  s  ) 

Definition at line 181 of file llviewerkeyboard.cpp.

References gAgent, KEYSTATE_UP, and LLAgent::movePitch().

Referenced by bind_keyboard_functions().

void agent_push_backward ( EKeystate  s  ) 

Definition at line 103 of file llviewerkeyboard.cpp.

References gAgent, LLKeyboard::getCurKeyElapsedFrameCount(), LLKeyboard::getCurKeyElapsedTime(), gKeyboard, KEYSTATE_UP, llround(), LLAgent::moveAt(), LLAgent::moveAtNudge(), NUDGE_FRAMES, NUDGE_TIME, and S32.

Referenced by bind_keyboard_functions(), and camera_move_backward_sitting().

void agent_push_down ( EKeystate  s  ) 

Definition at line 80 of file llviewerkeyboard.cpp.

References gAgent, KEYSTATE_UP, and LLAgent::moveUp().

Referenced by bind_keyboard_functions(), and camera_spin_under_sitting().

void agent_push_forward ( EKeystate  s  ) 

Definition at line 86 of file llviewerkeyboard.cpp.

References gAgent, LLKeyboard::getCurKeyElapsedFrameCount(), LLKeyboard::getCurKeyElapsedTime(), gKeyboard, KEYSTATE_UP, llround(), LLAgent::moveAt(), LLAgent::moveAtNudge(), NUDGE_FRAMES, NUDGE_TIME, and S32.

Referenced by bind_keyboard_functions(), and camera_move_forward_sitting().

void agent_slide_left ( EKeystate  s  ) 

Definition at line 119 of file llviewerkeyboard.cpp.

References gAgent, LLKeyboard::getCurKeyElapsedFrameCount(), LLKeyboard::getCurKeyElapsedTime(), gKeyboard, KEYSTATE_UP, llround(), LLAgent::moveLeft(), LLAgent::moveLeftNudge(), NUDGE_FRAMES, NUDGE_TIME, and S32.

Referenced by agent_turn_left(), and bind_keyboard_functions().

void agent_slide_right ( EKeystate  s  ) 

Definition at line 136 of file llviewerkeyboard.cpp.

References gAgent, LLKeyboard::getCurKeyElapsedFrameCount(), LLKeyboard::getCurKeyElapsedTime(), gKeyboard, KEYSTATE_UP, llround(), LLAgent::moveLeft(), LLAgent::moveLeftNudge(), NUDGE_FRAMES, NUDGE_TIME, and S32.

Referenced by agent_turn_right(), and bind_keyboard_functions().

void agent_toggle_fly ( EKeystate  s  ) 

Definition at line 196 of file llviewerkeyboard.cpp.

References gAgent, KEYSTATE_DOWN, and LLAgent::toggleFlying().

Referenced by bind_keyboard_functions().

void agent_turn_left ( EKeystate  s  ) 

Definition at line 152 of file llviewerkeyboard.cpp.

References agent_slide_left(), gAgent, LLKeyboard::getCurKeyElapsedTime(), LLFloaterMove::getYawRate(), gKeyboard, gToolCamera, KEYSTATE_UP, LLToolCamera::mouseSteerMode(), and LLAgent::moveYaw().

Referenced by bind_keyboard_functions(), and camera_spin_around_cw_sitting().

void agent_turn_right ( EKeystate  s  ) 

Definition at line 167 of file llviewerkeyboard.cpp.

References agent_slide_right(), gAgent, LLKeyboard::getCurKeyElapsedTime(), LLFloaterMove::getYawRate(), gKeyboard, gToolCamera, KEYSTATE_UP, LLToolCamera::mouseSteerMode(), and LLAgent::moveYaw().

Referenced by bind_keyboard_functions(), and camera_spin_around_ccw_sitting().

void bind_keyboard_functions (  ) 

Definition at line 483 of file llviewerkeyboard.cpp.

References agent_jump(), agent_look_down(), agent_look_up(), agent_push_backward(), agent_push_down(), agent_push_forward(), agent_slide_left(), agent_slide_right(), agent_toggle_fly(), agent_turn_left(), agent_turn_right(), LLViewerKeyboard::bindNamedFunction(), camera_move_backward(), camera_move_backward_fast(), camera_move_backward_sitting(), camera_move_forward(), camera_move_forward_fast(), camera_move_forward_sitting(), camera_pan_down(), camera_pan_in(), camera_pan_left(), camera_pan_out(), camera_pan_right(), camera_pan_up(), camera_spin_around_ccw(), camera_spin_around_ccw_sitting(), camera_spin_around_cw(), camera_spin_around_cw_sitting(), camera_spin_over(), camera_spin_over_sitting(), camera_spin_under(), camera_spin_under_sitting(), edit_avatar_move_backward(), edit_avatar_move_forward(), edit_avatar_spin_ccw(), edit_avatar_spin_cw(), edit_avatar_spin_over(), edit_avatar_spin_under(), gViewerKeyboard, start_chat(), and stop_moving().

Referenced by main().

void camera_move_backward ( EKeystate  s  ) 

Definition at line 321 of file llviewerkeyboard.cpp.

References gAgent, get_orbit_rate(), KEYSTATE_UP, LLAgent::setOrbitOutKey(), and LLAgent::unlockView().

Referenced by bind_keyboard_functions().

void camera_move_backward_fast ( EKeystate  s  ) 

Definition at line 405 of file llviewerkeyboard.cpp.

References f, gAgent, KEYSTATE_UP, LLAgent::setOrbitOutKey(), and LLAgent::unlockView().

Referenced by bind_keyboard_functions().

void camera_move_backward_sitting ( EKeystate  s  ) 

Definition at line 342 of file llviewerkeyboard.cpp.

References agent_push_backward(), LLAgent::backwardGrabbed(), gAgent, get_orbit_rate(), KEYSTATE_UP, LLAgent::setOrbitOutKey(), and LLAgent::sitCameraEnabled().

Referenced by bind_keyboard_functions().

void camera_move_forward ( EKeystate  s  ) 

Definition at line 313 of file llviewerkeyboard.cpp.

References gAgent, get_orbit_rate(), KEYSTATE_UP, LLAgent::setOrbitInKey(), and LLAgent::unlockView().

Referenced by bind_keyboard_functions().

void camera_move_forward_fast ( EKeystate  s  ) 

Definition at line 398 of file llviewerkeyboard.cpp.

References f, gAgent, KEYSTATE_UP, LLAgent::setOrbitInKey(), and LLAgent::unlockView().

Referenced by bind_keyboard_functions().

void camera_move_forward_sitting ( EKeystate  s  ) 

Definition at line 328 of file llviewerkeyboard.cpp.

References agent_push_forward(), LLAgent::forwardGrabbed(), gAgent, get_orbit_rate(), KEYSTATE_UP, LLAgent::setOrbitInKey(), and LLAgent::sitCameraEnabled().

Referenced by bind_keyboard_functions().

void camera_pan_down ( EKeystate  s  ) 

Definition at line 363 of file llviewerkeyboard.cpp.

References gAgent, get_orbit_rate(), KEYSTATE_UP, LLAgent::setPanDownKey(), and LLAgent::unlockView().

Referenced by bind_keyboard_functions().

void camera_pan_in ( EKeystate  s  ) 

Definition at line 384 of file llviewerkeyboard.cpp.

References gAgent, get_orbit_rate(), KEYSTATE_UP, LLAgent::setPanInKey(), and LLAgent::unlockView().

Referenced by bind_keyboard_functions().

void camera_pan_left ( EKeystate  s  ) 

Definition at line 370 of file llviewerkeyboard.cpp.

References gAgent, get_orbit_rate(), KEYSTATE_UP, LLAgent::setPanLeftKey(), and LLAgent::unlockView().

Referenced by bind_keyboard_functions().

void camera_pan_out ( EKeystate  s  ) 

Definition at line 391 of file llviewerkeyboard.cpp.

References gAgent, get_orbit_rate(), KEYSTATE_UP, LLAgent::setPanOutKey(), and LLAgent::unlockView().

Referenced by bind_keyboard_functions().

void camera_pan_right ( EKeystate  s  ) 

Definition at line 377 of file llviewerkeyboard.cpp.

References gAgent, get_orbit_rate(), KEYSTATE_UP, LLAgent::setPanRightKey(), and LLAgent::unlockView().

Referenced by bind_keyboard_functions().

void camera_pan_up ( EKeystate  s  ) 

Definition at line 356 of file llviewerkeyboard.cpp.

References gAgent, get_orbit_rate(), KEYSTATE_UP, LLAgent::setPanUpKey(), and LLAgent::unlockView().

Referenced by bind_keyboard_functions().

void camera_spin_around_ccw ( EKeystate  s  ) 

Definition at line 220 of file llviewerkeyboard.cpp.

References gAgent, get_orbit_rate(), KEYSTATE_UP, LLAgent::setOrbitLeftKey(), and LLAgent::unlockView().

Referenced by bind_keyboard_functions().

void camera_spin_around_ccw_sitting ( EKeystate  s  ) 

Definition at line 235 of file llviewerkeyboard.cpp.

References agent_turn_right(), gAgent, get_orbit_rate(), KEYSTATE_UP, LLAgent::rotateGrabbed(), LLAgent::setOrbitLeftKey(), and LLAgent::sitCameraEnabled().

Referenced by bind_keyboard_functions().

void camera_spin_around_cw ( EKeystate  s  ) 

Definition at line 228 of file llviewerkeyboard.cpp.

References gAgent, get_orbit_rate(), KEYSTATE_UP, LLAgent::setOrbitRightKey(), and LLAgent::unlockView().

Referenced by bind_keyboard_functions().

void camera_spin_around_cw_sitting ( EKeystate  s  ) 

Definition at line 251 of file llviewerkeyboard.cpp.

References agent_turn_left(), gAgent, get_orbit_rate(), KEYSTATE_UP, LLAgent::rotateGrabbed(), LLAgent::setOrbitRightKey(), and LLAgent::sitCameraEnabled().

Referenced by bind_keyboard_functions().

void camera_spin_over ( EKeystate  s  ) 

Definition at line 267 of file llviewerkeyboard.cpp.

References gAgent, get_orbit_rate(), KEYSTATE_UP, LLAgent::setOrbitUpKey(), and LLAgent::unlockView().

Referenced by bind_keyboard_functions().

void camera_spin_over_sitting ( EKeystate  s  ) 

Definition at line 282 of file llviewerkeyboard.cpp.

References agent_jump(), gAgent, get_orbit_rate(), KEYSTATE_UP, LLAgent::setOrbitUpKey(), LLAgent::sitCameraEnabled(), and LLAgent::upGrabbed().

Referenced by bind_keyboard_functions().

void camera_spin_under ( EKeystate  s  ) 

Definition at line 275 of file llviewerkeyboard.cpp.

References gAgent, get_orbit_rate(), KEYSTATE_UP, LLAgent::setOrbitDownKey(), and LLAgent::unlockView().

Referenced by bind_keyboard_functions().

void camera_spin_under_sitting ( EKeystate  s  ) 

Definition at line 298 of file llviewerkeyboard.cpp.

References agent_push_down(), LLAgent::downGrabbed(), gAgent, get_orbit_rate(), KEYSTATE_UP, LLAgent::setOrbitDownKey(), and LLAgent::sitCameraEnabled().

Referenced by bind_keyboard_functions().

void edit_avatar_move_backward ( EKeystate  s  ) 

Definition at line 456 of file llviewerkeyboard.cpp.

References gAgent, get_orbit_rate(), gMorphView, KEYSTATE_UP, LLMorphView::setCameraDrivenByKeys(), LLAgent::setOrbitOutKey(), and TRUE.

Referenced by bind_keyboard_functions().

void edit_avatar_move_forward ( EKeystate  s  ) 

Definition at line 447 of file llviewerkeyboard.cpp.

References gAgent, get_orbit_rate(), gMorphView, KEYSTATE_UP, LLMorphView::setCameraDrivenByKeys(), LLAgent::setOrbitInKey(), and TRUE.

Referenced by bind_keyboard_functions().

void edit_avatar_spin_ccw ( EKeystate  s  ) 

Definition at line 413 of file llviewerkeyboard.cpp.

References gAgent, get_orbit_rate(), gMorphView, KEYSTATE_UP, LLMorphView::setCameraDrivenByKeys(), LLAgent::setOrbitLeftKey(), and TRUE.

Referenced by bind_keyboard_functions().

void edit_avatar_spin_cw ( EKeystate  s  ) 

Definition at line 422 of file llviewerkeyboard.cpp.

References gAgent, get_orbit_rate(), gMorphView, KEYSTATE_UP, LLMorphView::setCameraDrivenByKeys(), LLAgent::setOrbitRightKey(), and TRUE.

Referenced by bind_keyboard_functions().

void edit_avatar_spin_over ( EKeystate  s  ) 

Definition at line 430 of file llviewerkeyboard.cpp.

References gAgent, get_orbit_rate(), gMorphView, KEYSTATE_UP, LLMorphView::setCameraDrivenByKeys(), LLAgent::setOrbitUpKey(), and TRUE.

Referenced by bind_keyboard_functions().

void edit_avatar_spin_under ( EKeystate  s  ) 

Definition at line 439 of file llviewerkeyboard.cpp.

References gAgent, get_orbit_rate(), gMorphView, KEYSTATE_UP, LLMorphView::setCameraDrivenByKeys(), LLAgent::setOrbitDownKey(), and TRUE.

Referenced by bind_keyboard_functions().

F32 get_orbit_rate (  ) 

Definition at line 205 of file llviewerkeyboard.cpp.

References LLKeyboard::getCurKeyElapsedTime(), gKeyboard, NUDGE_TIME, and ORBIT_NUDGE_RATE.

Referenced by camera_move_backward(), camera_move_backward_sitting(), camera_move_forward(), camera_move_forward_sitting(), camera_pan_down(), camera_pan_in(), camera_pan_left(), camera_pan_out(), camera_pan_right(), camera_pan_up(), camera_spin_around_ccw(), camera_spin_around_ccw_sitting(), camera_spin_around_cw(), camera_spin_around_cw_sitting(), camera_spin_over(), camera_spin_over_sitting(), camera_spin_under(), camera_spin_under_sitting(), edit_avatar_move_backward(), edit_avatar_move_forward(), edit_avatar_spin_ccw(), edit_avatar_spin_cw(), edit_avatar_spin_over(), and edit_avatar_spin_under().

void start_chat ( EKeystate  s  ) 

Definition at line 474 of file llviewerkeyboard.cpp.

References gChatBar, LLChatBar::inputEditorHasFocus(), NULL, and LLChatBar::startChat().

Referenced by bind_keyboard_functions().

void stop_moving ( EKeystate  s  ) 

Definition at line 464 of file llviewerkeyboard.cpp.

References AGENT_CONTROL_STOP, gAgent, KEYSTATE_UP, LLAgent::setControlFlags(), and LLAgent::stopAutoPilot().

Referenced by bind_keyboard_functions().


Variable Documentation

const F32 FLY_FRAMES = 4

Definition at line 51 of file llviewerkeyboard.cpp.

Referenced by agent_jump().

const F32 FLY_TIME = 0.5f

Definition at line 50 of file llviewerkeyboard.cpp.

Referenced by agent_jump().

LLViewerKeyboard gViewerKeyboard

Definition at line 58 of file llviewerkeyboard.cpp.

Referenced by bind_keyboard_functions(), LLViewerKeyboard::handleKey(), LLViewerWindow::handleScanKey(), LLViewerWindow::handleTranslatedKeyDown(), LLViewerWindow::handleUnicodeChar(), and main().

const S32 NUDGE_FRAMES = 2

Definition at line 54 of file llviewerkeyboard.cpp.

Referenced by agent_push_backward(), agent_push_forward(), agent_slide_left(), and agent_slide_right().

const F32 NUDGE_TIME = 0.25f

Definition at line 53 of file llviewerkeyboard.cpp.

const F32 ORBIT_NUDGE_RATE = 0.05f

Definition at line 55 of file llviewerkeyboard.cpp.

const F32 YAW_NUDGE_RATE = 0.05f

Definition at line 56 of file llviewerkeyboard.cpp.


Generated on Thu Jul 1 06:10:47 2010 for Second Life Viewer by  doxygen 1.4.7