ResidualVM logo ResidualVM website - Forums - Contact us BuildBot - Doxygen - Wiki curved edge

#include <keymap.h>

Collaboration diagram for Common::Keymap:

List of all members.

Public Types

enum  KeymapType { kKeymapTypeGlobal, kKeymapTypeGui, kKeymapTypeGame }
enum  KeymapMatch { kKeymapMatchNone, kKeymapMatchPartial, kKeymapMatchExact }
typedef Array< Action * > ActionArray

Public Member Functions

 Keymap (KeymapType type, const String &id, const U32String &description)
 Keymap (KeymapType type, const String &id, const String &description)
 ~Keymap ()
void setConfigDomain (ConfigManager::Domain *configDomain)
void setHardwareInputs (HardwareInputSet *hardwareInputSet)
void setBackendDefaultBindings (const KeymapperDefaultBindings *backendDefaultBindings)
void registerMapping (Action *action, const HardwareInput &input)
 Registers a HardwareInput to the given Action.
void unregisterMapping (Action *action)
 Unregisters a HardwareInput from the given Action (if one is mapped).
void resetMapping (Action *action)
 Reset an action's mapping to its defaults.
Array< HardwareInputgetActionMapping (Action *action) const
 Find the hardware input an action is mapped to, if any.
KeymapMatch getMappedActions (const Event &event, ActionArray &actions) const
 Find the Actions that a hardware input is mapped to.
void addAction (Action *action)
 Adds a new Action to this Map.
const ActionArraygetActions () const
 Get the list of all the Actions contained in this Keymap.
StringArray getActionDefaultMappings (Action *action)
 Get the default input mappings for an action.
void loadMappings ()
 Load this keymap's mappings from the config manager.
void saveMappings ()
 Save this keymap's mappings to the config manager.
const StringgetId () const
const U32StringgetDescription () const
KeymapType getType () const
bool isEnabled () const
 Defines if the keymap is considered when mapping events.
void setEnabled (bool enabled)

Static Public Member Functions

static Array< Keymap * > arrayOf (Keymap *keymap)
 Helper to return an array with a single keymap element.

Private Types

typedef HashMap< HardwareInput,
ActionArray,
HardwareInput_Hash,
HardwareInput_EqualTo
HardwareActionMap

Private Member Functions

const ActionfindAction (const char *id) const
void registerMappings (Action *action, const StringArray &hwInputIds)
bool areMappingsIdentical (const Array< HardwareInput > &inputs, const StringArray &mapping)

Private Attributes

KeymapType _type
String _id
U32String _description
bool _enabled
ActionArray _actions
HardwareActionMap _hwActionMap
ConfigManager::Domain_configDomain
HardwareInputSet_hardwareInputSet
const KeymapperDefaultBindings_backendDefaultBindings

Detailed Description

Definition at line 67 of file keymap.h.


Member Typedef Documentation

Definition at line 81 of file keymap.h.


Member Enumeration Documentation

Enumerator:
kKeymapMatchNone 
kKeymapMatchPartial 
kKeymapMatchExact 

Definition at line 75 of file keymap.h.

Enumerator:
kKeymapTypeGlobal 
kKeymapTypeGui 
kKeymapTypeGame 

Definition at line 69 of file keymap.h.


Constructor & Destructor Documentation

Common::Keymap::Keymap ( KeymapType  type,
const String id,
const U32String description 
)

Definition at line 36 of file keymap.cpp.

Common::Keymap::Keymap ( KeymapType  type,
const String id,
const String description 
)

Definition at line 47 of file keymap.cpp.

Common::Keymap::~Keymap (  ) 

Definition at line 58 of file keymap.cpp.


Member Function Documentation

void Common::Keymap::addAction ( Action action  ) 

Adds a new Action to this Map.

Takes ownership of the action.

Parameters:
action the Action to add

Definition at line 63 of file keymap.cpp.

bool Common::Keymap::areMappingsIdentical ( const Array< HardwareInput > &  inputs,
const StringArray mapping 
) [private]

Definition at line 364 of file keymap.cpp.

static Array<Keymap *> Common::Keymap::arrayOf ( Keymap keymap  )  [inline, static]

Helper to return an array with a single keymap element.

Definition at line 169 of file keymap.h.

const Action * Common::Keymap::findAction ( const char *  id  )  const [private]

Definition at line 129 of file keymap.cpp.

StringArray Common::Keymap::getActionDefaultMappings ( Action action  ) 

Get the default input mappings for an action.

Backend-specific mappings replace the default mappings specified when creating the keymap.

Definition at line 260 of file keymap.cpp.

Array< HardwareInput > Common::Keymap::getActionMapping ( Action action  )  const

Find the hardware input an action is mapped to, if any.

Definition at line 111 of file keymap.cpp.

const ActionArray& Common::Keymap::getActions (  )  const [inline]

Get the list of all the Actions contained in this Keymap.

Definition at line 136 of file keymap.h.

const U32String& Common::Keymap::getDescription (  )  const [inline]

Definition at line 159 of file keymap.h.

const String& Common::Keymap::getId (  )  const [inline]

Definition at line 158 of file keymap.h.

Keymap::KeymapMatch Common::Keymap::getMappedActions ( const Event event,
ActionArray actions 
) const

Find the Actions that a hardware input is mapped to.

Parameters:
hardwareInput the input that is mapped to the required Action
actions an array containing pointers to the actions
Returns:
the matching status for the retieved actions

Definition at line 138 of file keymap.cpp.

KeymapType Common::Keymap::getType (  )  const [inline]

Definition at line 160 of file keymap.h.

bool Common::Keymap::isEnabled (  )  const [inline]

Defines if the keymap is considered when mapping events.

Definition at line 165 of file keymap.h.

void Common::Keymap::loadMappings (  ) 

Load this keymap's mappings from the config manager.

Parameters:
hwInputs the set to retrieve hardware input pointers from

Definition at line 285 of file keymap.cpp.

void Common::Keymap::registerMapping ( Action action,
const HardwareInput input 
)

Registers a HardwareInput to the given Action.

Parameters:
action Action in this Keymap
key pointer to HardwareInput to map
See also:
Action::mapKey

Definition at line 70 of file keymap.cpp.

void Common::Keymap::registerMappings ( Action action,
const StringArray hwInputIds 
) [private]

Definition at line 317 of file keymap.cpp.

void Common::Keymap::resetMapping ( Action action  ) 

Reset an action's mapping to its defaults.

Parameters:
action 

Definition at line 95 of file keymap.cpp.

void Common::Keymap::saveMappings (  ) 

Save this keymap's mappings to the config manager.

Note:
Changes are *not* flushed to disk, to do so call ConfMan.flushToDisk()

Definition at line 334 of file keymap.cpp.

void Common::Keymap::setBackendDefaultBindings ( const KeymapperDefaultBindings backendDefaultBindings  ) 

Definition at line 256 of file keymap.cpp.

void Common::Keymap::setConfigDomain ( ConfigManager::Domain configDomain  ) 

Definition at line 248 of file keymap.cpp.

void Common::Keymap::setEnabled ( bool  enabled  )  [inline]

Definition at line 166 of file keymap.h.

void Common::Keymap::setHardwareInputs ( HardwareInputSet hardwareInputSet  ) 

Definition at line 252 of file keymap.cpp.

void Common::Keymap::unregisterMapping ( Action action  ) 

Unregisters a HardwareInput from the given Action (if one is mapped).

Parameters:
action Action in this Keymap
See also:
Action::mapKey

Definition at line 80 of file keymap.cpp.


Member Data Documentation

Definition at line 188 of file keymap.h.

Definition at line 193 of file keymap.h.

Definition at line 191 of file keymap.h.

Definition at line 184 of file keymap.h.

bool Common::Keymap::_enabled [private]

Definition at line 186 of file keymap.h.

Definition at line 192 of file keymap.h.

Definition at line 189 of file keymap.h.

Definition at line 183 of file keymap.h.

Definition at line 182 of file keymap.h.


The documentation for this class was generated from the following files:


Generated on Sat Sep 19 2020 05:04:42 for ResidualVM by doxygen 1.7.1
curved edge   curved edge