ActionMap Class Reference

#include <actionMap.h>

Inheritance diagram for ActionMap:

Inheritance graph
[legend]
List of all members.

Detailed Description

Map raw inputs to a variety of actions.

This is used for all keymapping in the engine.

See also:
ActionMap::Node


Public Member Functions

 ActionMap ()
 ~ActionMap ()
void dumpActionMap (const char *fileName, const bool append) const
bool processBind (const U32 argc, const char **argv, SimObject *object=NULL)
bool processBindCmd (const char *device, const char *action, const char *makeCmd, const char *breakCmd)
bool processUnbind (const char *device, const char *action, SimObject *object=NULL)
bool processAction (const InputEventInfo *)
 DECLARE_CONOBJECT (ActionMap)
Console Interface Functions
const char * getBinding (const char *command)
 Find what the given command is bound to.
const char * getCommand (const char *device, const char *action)
 Find what command is bound to the given event descriptor .
bool isInverted (const char *device, const char *action)
F32 getScale (const char *device, const char *action)
const char * getDeadZone (const char *device, const char *action)

Static Public Member Functions

static bool createEventDescriptor (const char *pEventString, EventDescriptor *pDescriptor)
static bool getKeyString (const U32 action, char *buffer)
static bool getDeviceName (const U32 deviceType, const U32 deviceInstance, char *buffer)
static const char * buildActionString (const InputEventInfo *event)
static bool checkBreakTable (const InputEventInfo *)
static bool handleEvent (const InputEventInfo *)
static bool handleEventGlobal (const InputEventInfo *)
static void clearAllBreaks ()
 Called when we lose focus, to make sure we have no dangling inputs.
static bool checkAsciiGlobal (U16 key, U32 modifiers)
 Returns true if the specified key + modifiers are bound to something on the global action map.
static bool getDeviceTypeAndInstance (const char *device, U32 &deviceType, U32 &deviceInstance)

Protected Member Functions

bool onAdd ()
 Called when the object is added to the sim.
const NodefindNode (const U32 inDeviceType, const U32 inDeviceInst, const U32 inModifiers, const U32 inAction)
bool findBoundNode (const char *function, U32 &devMapIndex, U32 &nodeIndex)
bool nextBoundNode (const char *function, U32 &devMapIndex, U32 &nodeIndex)
NodegetNode (const U32 inDeviceType, const U32 inDeviceInst, const U32 inModifiers, const U32 inAction, SimObject *object=NULL)
void removeNode (const U32 inDeviceType, const U32 inDeviceInst, const U32 inModifiers, const U32 inAction, SimObject *object=NULL)
void enterBreakEvent (const InputEventInfo *pEvent, const Node *pNode)

Static Protected Member Functions

static const char * getModifierString (const U32 modifiers)
static void fireBreakEvent (U32 idx, F32 value=0.f)
 Pass index to a break entry, and this function will fire it off.

Protected Attributes

Vector< DeviceMap * > mDeviceMaps

Static Protected Attributes

static Vector< BreakEntrysmBreakTable

Private Types

typedef SimObject Parent

Classes

struct  BreakEntry
struct  DeviceMap
 Used to represent a devices. More...
struct  Node


Member Typedef Documentation

typedef SimObject ActionMap::Parent [private]

Reimplemented from SimObject.


Constructor & Destructor Documentation

ActionMap::ActionMap (  ) 

ActionMap::~ActionMap (  ) 


Member Function Documentation

bool ActionMap::onAdd (  )  [protected, virtual]

Called when the object is added to the sim.

Reimplemented from SimObject.

const Node* ActionMap::findNode ( const U32  inDeviceType,
const U32  inDeviceInst,
const U32  inModifiers,
const U32  inAction 
) [protected]

bool ActionMap::findBoundNode ( const char *  function,
U32 devMapIndex,
U32 nodeIndex 
) [protected]

bool ActionMap::nextBoundNode ( const char *  function,
U32 devMapIndex,
U32 nodeIndex 
) [protected]

Node* ActionMap::getNode ( const U32  inDeviceType,
const U32  inDeviceInst,
const U32  inModifiers,
const U32  inAction,
SimObject object = NULL 
) [protected]

void ActionMap::removeNode ( const U32  inDeviceType,
const U32  inDeviceInst,
const U32  inModifiers,
const U32  inAction,
SimObject object = NULL 
) [protected]

void ActionMap::enterBreakEvent ( const InputEventInfo pEvent,
const Node pNode 
) [protected]

static const char* ActionMap::getModifierString ( const U32  modifiers  )  [static, protected]

static void ActionMap::fireBreakEvent ( U32  idx,
F32  value = 0.f 
) [static, protected]

Pass index to a break entry, and this function will fire it off.

void ActionMap::dumpActionMap ( const char *  fileName,
const bool  append 
) const

static bool ActionMap::createEventDescriptor ( const char *  pEventString,
EventDescriptor pDescriptor 
) [static]

bool ActionMap::processBind ( const U32  argc,
const char **  argv,
SimObject object = NULL 
)

bool ActionMap::processBindCmd ( const char *  device,
const char *  action,
const char *  makeCmd,
const char *  breakCmd 
)

bool ActionMap::processUnbind ( const char *  device,
const char *  action,
SimObject object = NULL 
)

const char* ActionMap::getBinding ( const char *  command  ) 

Find what the given command is bound to.

const char* ActionMap::getCommand ( const char *  device,
const char *  action 
)

Find what command is bound to the given event descriptor .

bool ActionMap::isInverted ( const char *  device,
const char *  action 
)

F32 ActionMap::getScale ( const char *  device,
const char *  action 
)

const char* ActionMap::getDeadZone ( const char *  device,
const char *  action 
)

static bool ActionMap::getKeyString ( const U32  action,
char *  buffer 
) [static]

static bool ActionMap::getDeviceName ( const U32  deviceType,
const U32  deviceInstance,
char *  buffer 
) [static]

static const char* ActionMap::buildActionString ( const InputEventInfo event  )  [static]

bool ActionMap::processAction ( const InputEventInfo  ) 

static bool ActionMap::checkBreakTable ( const InputEventInfo  )  [static]

static bool ActionMap::handleEvent ( const InputEventInfo  )  [static]

static bool ActionMap::handleEventGlobal ( const InputEventInfo  )  [static]

static void ActionMap::clearAllBreaks (  )  [static]

Called when we lose focus, to make sure we have no dangling inputs.

This fires a break event for every currently pending item in the break table.

static bool ActionMap::checkAsciiGlobal ( U16  key,
U32  modifiers 
) [static]

Returns true if the specified key + modifiers are bound to something on the global action map.

static bool ActionMap::getDeviceTypeAndInstance ( const char *  device,
U32 deviceType,
U32 deviceInstance 
) [static]

ActionMap::DECLARE_CONOBJECT ( ActionMap   ) 


Member Data Documentation