#include <InputHandler.h>
Public Member Functions | |
void | CaptureInput (float sec) |
void | SetWindowExtents (int width, int height) |
Set mouse region (if window resizes, we should alter this to reflect as well). | |
void | UnattachOIS () |
unattach OIS before window shutdown | |
float | GetMouseSens () |
for setting control | |
void | SetMouseSens (float newSens) |
bool | GetMouseInvertState () |
returns MouseInverted State | |
void | SetMouseInvertState (bool newState) |
sets MouseInverted State to newState | |
bool | IsKeyboardShiftOn () |
A way for other modules to query shift=button press (unbuffered access). | |
bool | IsKeyboardFocused () |
returns true is keyboard focus is on (valid for FC App only) | |
void | SetKeyboardFocused (bool state) |
sets keyborad focus state to 'state' | |
bool | IsJoystickEnabled () |
returns true if a joystick handler is valid | |
bool | SetJoystickEnabled (bool newState) |
returns true when operation is successful. | |
Static Public Member Functions | |
static CInputHandler * | GetInstance () |
sub classes should implement this for easy access to self (which is a singleton) | |
Private Member Functions | |
CInputHandler (Ogre::RenderWindow *win) | |
opens buffered keyboard, mouse and (if possible) joystick handlers | |
bool | keyPressed (const OIS::KeyEvent &arg) |
OIS::Keylistener Press (receiving bufferd keyboard input). | |
bool | keyPressed_TR (const OIS::KeyEvent &arg) |
TR key press handler. | |
bool | keyPressed_FC (const OIS::KeyEvent &arg) |
FC key press handler. | |
bool | keyReleased (const OIS::KeyEvent &arg) |
OIS::Keylistener Release (receiving bufferd keyboard input). | |
bool | keyReleased_TR (const OIS::KeyEvent &arg) |
TR key release handler. | |
bool | keyReleased_FC (const OIS::KeyEvent &arg) |
FC key release handler. | |
bool | mouseMoved (const OIS::MouseEvent &arg) |
OIS::Mouselistener Move (receiving bufferd mouse input). | |
bool | mouseMoved_TR (const OIS::MouseEvent &arg) |
TR mouse moved handler. | |
bool | mouseMoved_FC (const OIS::MouseEvent &arg) |
FC mouse moved handler. | |
bool | mousePressed (const OIS::MouseEvent &arg, OIS::MouseButtonID id) |
OIS::Mouselistener Press (receiving bufferd mouse input). | |
bool | mousePressed_TR (const OIS::MouseEvent &arg, OIS::MouseButtonID id) |
TR mouse button pressed handler. | |
bool | mousePressed_FC (const OIS::MouseEvent &arg, OIS::MouseButtonID id) |
FC mouse button pressed handler. | |
bool | mouseReleased (const OIS::MouseEvent &arg, OIS::MouseButtonID id) |
OIS::Mouselistener Release (receiving bufferd mouse input). | |
bool | mouseReleased_TR (const OIS::MouseEvent &arg, OIS::MouseButtonID id) |
TR mouse button released handler. | |
bool | mouseReleased_FC (const OIS::MouseEvent &arg, OIS::MouseButtonID id) |
FC mouse button released handler. | |
bool | povMoved (const OIS::JoyStickEvent &, int povId) |
OIS::JoystickListener povMove. | |
bool | axisMoved (const OIS::JoyStickEvent &arg, int axis) |
OIS::JoystickListener axisMove. | |
bool | sliderMoved (const OIS::JoyStickEvent &, int sliderId) |
OIS::JoystickListener sldierMove. | |
bool | buttonPressed (const OIS::JoyStickEvent &arg, int button) |
OIS::JoystickListener buttonPress. | |
bool | buttonReleased (const OIS::JoyStickEvent &arg, int button) |
OIS::JoystickListener buttonRelease. | |
bool | ProcessUnbufferedKeyboardInput (float sec) |
for unbuffered processing of Keyboard (for inputs that matter in continous time) | |
bool | ProcessUnbufferedJoystickInput_TR (float sec) |
updates pov using pov button states | |
Private Attributes | |
OIS::InputManager * | mInputManager |
Main gate to OIS Input system. | |
OIS::Mouse * | mMouse |
Mouse manager. | |
OIS::Keyboard * | mKeyboard |
Keyboard Manager. | |
OIS::JoyStick * | mJoystick |
Joystick Manager (Set to NULL is Joystick is not available). | |
bool | fps_shown |
is fps overlay shown? | |
float | mouseSensitivity |
it is between 0 and 5 | |
bool | mode_camLook_FC |
is mouse in camLook Mode (FC only) | |
bool | mMouseInverted |
set to true if you want mouse up move to correspond to camera down move | |
bool | mKeyboardFocused |
FC Sim screen only, if enabled, input passes to gui, else it is processed by OPSIMUS. |
THIS MODULE HAS DEPENDENCIES TO
void CInputHandler::CaptureInput | ( | float | sec | ) |
you must call this in each frame start
sec | indicates amount of real time passed since last call to this function |
void CInputHandler::SetMouseSens | ( | float | newSens | ) |
sets mouse sensitivity
newSens | this must be between 0.5 and 2. Larger means the mouse is more sensitive |