Control.h File Reference

Control classes, key bindings, and utilities : used as an abstraction for inputs. More...

#include <PVLE/Export.h>
#include <PVLE/Util/Util.h>
#include <bitset>
#include <osg/Vec3>
#include <PVLE/Config.h>
#include <map>
#include <boost/filesystem/path.hpp>

Include dependency graph for Control.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  ControlState
 A control state is a set of values describing at any moment the state of switches (keys and buttons) and axis. More...
class  ControlEvent
 Describes a change in a ControlState and some other useful data. More...
union  ControlEvent::TEventDependantData
 Data of an event of a control, which can be an axis or a switch (union). More...
class  NetControlEvent
class  Controler
 Base class defining a storage for control state and events. More...
class  AxisControl
 Represents a controlled axis (mouse, joystick. More...

Namespaces

namespace  TNL
namespace  boost
namespace  boost::serialization

Typedefs

typedef std::vector< ControlEventControlEventList
typedef void TNL::EventConnection
typedef std::map< int,
ControlState::ESwitchId
Bindings
 Switch (keys and buttons) bindings map.
typedef std::map< int,
AxisControl
AxisBindings
 Axis bindings map.

Functions

PVLE_EXPORT void saveBindings (const Bindings &k, const AxisBindings &a, const boost::filesystem::path &path, const char **userSwitchesNames=NULL, UINT nbUserSwitchesNames=0, UINT userBindingsFileVersion=0)
 Saves key and axis bindings.
PVLE_EXPORT bool loadBindings (Bindings &k, AxisBindings &a, const boost::filesystem::path &path, const char **userSwitchesNames=NULL, UINT nbUserSwitchesNames=0, UINT userBindingsFileVersion=0)
PVLE_EXPORT void setDefaultBindings (Bindings &k, AxisBindings &a)

Variables

const UINT BUTTON_MOUSE_MODIFIER = 0x10000
 Offset applied to mouse buttons for Bindings map key (ex : if a key is BUTTON_MOUSE_MODIFIER +n then it represents the mouse button n).
const UINT BUTTON_JOY_MODIFIER = 0x10020
 Similar to BUTTON_MOUSE_MODIFIER.
const UINT AXIS_MOUSE_MODIFIER = 0
 Offset applied to mouse axis for AxisBindings map key (ex : if a key is AXIS_MOUSE_MODIFIER +n then it represents the mouse axis n).
const UINT AXIS_JOY_MODIFIER = 0x10
 Similar to AXIS_MOUSE_MODIFIER.


Detailed Description

Control classes, key bindings, and utilities : used as an abstraction for inputs.

Definition in file Control.h.


Typedef Documentation

typedef std::map<int, AxisControl> AxisBindings

Axis bindings map.

Definition at line 401 of file Control.h.

typedef std::map<int, ControlState::ESwitchId> Bindings

Switch (keys and buttons) bindings map.

Definition at line 361 of file Control.h.

typedef std::vector<ControlEvent> ControlEventList

Definition at line 221 of file Control.h.


Function Documentation

PVLE_EXPORT bool loadBindings ( Bindings k,
AxisBindings a,
const boost::filesystem::path &  path,
const char **  userSwitchesNames = NULL,
UINT  nbUserSwitchesNames = 0,
UINT  userBindingsFileVersion = 0 
)

Todo:
Use a real parser, such as boost.program_options or boost.spririt

PVLE_EXPORT void saveBindings ( const Bindings k,
const AxisBindings a,
const boost::filesystem::path &  path,
const char **  userSwitchesNames = NULL,
UINT  nbUserSwitchesNames = 0,
UINT  userBindingsFileVersion = 0 
)

Saves key and axis bindings.

Quick 'n' dirty : boost::serialization seems to have problems serializing the map... :( Please note that userSwitchesNames[] must be given if you use custom swiches (>= USER_SWITCH_0). In that case, textual representation of switch USER_SWITCH_0+n is userSwitchesNames[n].

Todo:
Use a real parser, such as boost.program_options or boost.spririt

PVLE_EXPORT void setDefaultBindings ( Bindings k,
AxisBindings a 
)

Referenced by loadBindings().


Variable Documentation

const UINT AXIS_JOY_MODIFIER = 0x10

Similar to AXIS_MOUSE_MODIFIER.

Definition at line 405 of file Control.h.

Referenced by loadBindings(), and saveBindings().

Offset applied to mouse axis for AxisBindings map key (ex : if a key is AXIS_MOUSE_MODIFIER +n then it represents the mouse axis n).

Definition at line 403 of file Control.h.

Referenced by ControlMapper::handle(), loadBindings(), saveBindings(), and setDefaultBindings().

const UINT BUTTON_JOY_MODIFIER = 0x10020

Similar to BUTTON_MOUSE_MODIFIER.

Definition at line 365 of file Control.h.

const UINT BUTTON_MOUSE_MODIFIER = 0x10000

Offset applied to mouse buttons for Bindings map key (ex : if a key is BUTTON_MOUSE_MODIFIER +n then it represents the mouse button n).

Definition at line 363 of file Control.h.

Referenced by ControlMapper::handle(), and setDefaultBindings().


Generated on Sun Jan 17 11:38:59 2010 for PVLE (Pro-Vocation Light Engine) by  doxygen 1.5.9