#include <PVLE/Config.h>
#include <PVLE/Input/Control.h>
#include <PVLE/Util/Singleton.h>
#include <boost/static_assert.hpp>
#include <boost/lexical_cast.hpp>
#include <boost/cast.hpp>
#include <osg/ref_ptr>
#include <algorithm>
#include <fstream>
#include <osgGA/GUIEventAdapter>
Go to the source code of this file.
Classes | |
class | KeyMap |
Maps IDs to strings for keys. More... | |
class | InvKeyMap |
Maps strings to IDs for keys. More... | |
struct | SimpleStrComp |
Defines | |
#define | axisName switchName |
Functions | |
BOOST_STATIC_ASSERT (sizeof(switchesNames)/sizeof(char *)==ControlState::MAX_STARNDARD_SWITCH) | |
void | saveBindings (const Bindings &k, const AxisBindings &a, const boost::filesystem::path &path, const char **userSwitchesNames, UINT nbUserSwitchesNames, UINT userBindingsFileVersion) |
bool | loadBindings (Bindings &k, AxisBindings &a, const boost::filesystem::path &path, const char **userSwitchesNames, UINT nbUserSwitchesNames, UINT userBindingsFileVersion) |
void | setDefaultBindings (Bindings &k, AxisBindings &a) |
Variables | |
const char * | switchesNames [] |
const char * | axisNames [ControlState::MAX_AXIS] |
const char *const | VERSION_TEXT = "Version:" |
const char *const | SWITCHES_TEXT = "-----Key_bindings-----" |
const char *const | AXIS_TEXT = "-----Axis_bindings-----" |
const UINT | BINDINGS_FILE_VERSION = 5 |
#define axisName switchName |
Referenced by loadBindings().
BOOST_STATIC_ASSERT | ( | sizeof(switchesNames)/sizeof(char *) | = =ControlState::MAX_STARNDARD_SWITCH |
) |
bool loadBindings | ( | Bindings & | k, | |
AxisBindings & | a, | |||
const boost::filesystem::path & | path, | |||
const char ** | userSwitchesNames, | |||
UINT | nbUserSwitchesNames, | |||
UINT | userBindingsFileVersion | |||
) |
Definition at line 346 of file Control.cpp.
References AxisControl::accel, ASSERT, AXIS_JOY_MODIFIER, AXIS_MOUSE_MODIFIER, AxisControl::axisId, axisName, DBG_TRY_BLOCK_END, DBG_TRY_BLOCK_START, AxisControl::deadzone, LOG_ERROR, ControlState::MAX_AXIS, ControlState::MAX_STARNDARD_SWITCH, ControlState::NB_USER_SWITCHES, AxisControl::sensitivity, setDefaultBindings(), switchesNames, and ControlState::USER_SWITCH_0.
void saveBindings | ( | const Bindings & | k, | |
const AxisBindings & | a, | |||
const boost::filesystem::path & | path, | |||
const char ** | userSwitchesNames, | |||
UINT | nbUserSwitchesNames, | |||
UINT | userBindingsFileVersion | |||
) |
Definition at line 298 of file Control.cpp.
References ASSERT, AXIS_JOY_MODIFIER, AXIS_MOUSE_MODIFIER, DBG_TRY_BLOCK_END, DBG_TRY_BLOCK_START, ControlState::MAX_AXIS, ControlState::MAX_STARNDARD_SWITCH, ControlState::MAX_SWITCH, ControlState::NB_USER_SWITCHES, switchesNames, and ControlState::USER_SWITCH_0.
void setDefaultBindings | ( | Bindings & | k, | |
AxisBindings & | a | |||
) |
Definition at line 458 of file Control.cpp.
References AXIS_MOUSE_MODIFIER, ControlState::AXIS_SCROLL_1, ControlState::AXIS_SCROLL_2, ControlState::AXIS_X, ControlState::AXIS_Y, ControlState::BACKWARD, ControlState::BRAKE, BUTTON_MOUSE_MODIFIER, ControlState::CANCEL, ControlState::CROUCH, ControlState::DOWN, ControlState::DROP_ALTERNATE, ControlState::DROP_WEAPON, ControlState::FAST_TOGGLE, ControlState::FASTER, ControlState::FIRE1, ControlState::FORWARD, ControlState::JUMP, ControlState::LEFT, ControlState::MENU, ControlState::PAUSE, ControlState::RESET, ControlState::RIGHT, ControlState::SCORE_MENU, ControlState::SLOWER, ControlState::STRAFE_LEFT, ControlState::STRAFE_RIGHT, and ControlState::UP.
const char* const AXIS_TEXT = "-----Axis_bindings-----" |
Definition at line 133 of file Control.cpp.
const char* axisNames[ControlState::MAX_AXIS] |
Initial value:
{ "AXIS_X", "AXIS_Y", "AXIS_Z", "AXIS_SCROLL_1", "AXIS_SCROLL_2", "AXIS_SCROLL_3", "AXIS_SCROLL_4" }
Definition at line 82 of file Control.cpp.
const UINT BINDINGS_FILE_VERSION = 5 |
Definition at line 134 of file Control.cpp.
const char* const SWITCHES_TEXT = "-----Key_bindings-----" |
Definition at line 132 of file Control.cpp.
const char* switchesNames[] |
Initial value:
{ "NONE", "FORWARD", "BACKWARD", "LEFT", "RIGHT", "STRAFE_LEFT", "STRAFE_RIGHT", "UP", "DOWN", "ROLL_LEFT", "ROLL_RIGHT", "JUMP", "CROUCH", "FAST_TOGGLE", "ALWAYS_FAST", "FASTER", "SLOWER", "FIRE1", "FIRE2", "FIRE3", "FIRE4", "FIRE5", "WEAPON_NEXT", "WEAPON_PREV", "WEAPON_TOGGLE", "WEAPON1", "WEAPON2", "WEAPON3", "WEAPON4", "WEAPON5", "WEAPON6", "WEAPON7", "WEAPON8", "WEAPON9", "WEAPON10", "WEAPON11", "WEAPON12", "WEAPON13", "WEAPON14", "WEAPON15", "WEAPON16", "WEAPON17", "WEAPON18", "WEAPON19", "WEAPON20", "DROP_WEAPON", "DROP_ALTERNATE", "TARGET", "TARGET_NEXT", "TARGET_PREV", "SHOW_INFO", "VIEW_NEXT", "VIEW_PREV", "ZOOM_IN", "ZOOM_OUT", "VIEW1", "VIEW2", "VIEW3", "VIEW4", "VIEW5", "VIEW6", "VIEW7", "VIEW8", "VIEW9", "VIEW10", "VIEW11", "VIEW12", "VIEW13", "VIEW14", "VIEW15", "PAUSE", "SCREENSHOT", "TOGGLE_FULLSCREEN", "BRAKE", "RESET", "MENU", "SCORE_MENU", "OK", "CANCEL" }
Definition at line 56 of file Control.cpp.
Referenced by loadBindings(), and saveBindings().
const char* const VERSION_TEXT = "Version:" |
Definition at line 131 of file Control.cpp.