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

#include <keymapper.h>

Inheritance diagram for Common::Keymapper:
Collaboration diagram for Common::Keymapper:

List of all members.

Public Member Functions

 Keymapper (EventManager *eventMan)
 ~Keymapper ()
virtual List< EventmapEvent (const Event &ev)
 Map an incoming event to one or more action events.
void registerHardwareInputSet (HardwareInputSet *inputs, KeymapperDefaultBindings *backendDefaultBindings)
 Registers a HardwareInputSet and platform-specific default mappings with the Keymapper.
void addGlobalKeymap (Keymap *keymap)
 Add a keymap to the global domain.
void addGameKeymap (Keymap *keymap)
 Add a keymap to the game domain.
void cleanupGameKeymaps ()
 Should be called at end of game to tell Keymapper to deactivate and free any game keymaps that are loaded.
KeymapgetKeymap (const String &id) const
 Obtain a keymap of the given name from the keymapper.
const KeymapArraygetKeymaps () const
 Obtain a list of all the keymaps registered with the keymapper.
void reloadAllMappings ()
 reload the mappings for all the keymaps from the configuration manager
void setEnabledKeymapType (Keymap::KeymapType type)
 Set which kind of keymap is currently used to map events.
void setEnabled (bool enabled)
 Enable/disable the keymapper.
void clear ()
 Clear all the keymaps and hardware input sets.
HardwareInput findHardwareInput (const Event &event)
 Return a HardwareInput pointer for the given event.
void initKeymap (Keymap *keymap, ConfigManager::Domain *domain)
void reloadKeymapMappings (Keymap *keymap)

Private Types

enum  IncomingEventType { kIncomingEventIgnored, kIncomingEventStart, kIncomingEventEnd, kIncomingEventInstant }
enum  { kJoyAxisPressedTreshold = Common::JOYAXIS_MAX / 2, kJoyAxisUnpressedTreshold = Common::JOYAXIS_MAX / 4 }

Private Member Functions

Keymap::KeymapMatch getMappedActions (const Event &event, Keymap::ActionArray &actions, Keymap::KeymapType keymapType) const
Event executeAction (const Action *act, const Event &incomingEvent)
EventType convertStartToEnd (EventType eventType)
IncomingEventType convertToIncomingEventType (const Event &ev) const
void hardcodedEventMapping (Event ev)
void resetInputState ()

Private Attributes

EventManager_eventMan
HardwareInputSet_hardwareInputs
KeymapperDefaultBindings_backendDefaultBindings
DelayedEventSource_delayedEventSource
bool _enabled
Keymap::KeymapType _enabledKeymapType
KeymapArray _keymaps
bool _joystickAxisPreviouslyPressed [6]

Detailed Description

Definition at line 45 of file keymapper.h.


Member Enumeration Documentation

anonymous enum [private]
Enumerator:
kJoyAxisPressedTreshold 
kJoyAxisUnpressedTreshold 

Definition at line 141 of file keymapper.h.

Enumerator:
kIncomingEventIgnored 
kIncomingEventStart 
kIncomingEventEnd 
kIncomingEventInstant 

Definition at line 134 of file keymapper.h.


Constructor & Destructor Documentation

Common::Keymapper::Keymapper ( EventManager eventMan  ) 

Definition at line 37 of file keymapper.cpp.

Common::Keymapper::~Keymapper (  ) 

Definition at line 48 of file keymapper.cpp.


Member Function Documentation

void Common::Keymapper::addGameKeymap ( Keymap keymap  ) 

Add a keymap to the game domain.

Transfers ownership of the keymap to the Keymapper

See also:
addGlobalKeyMap
Note:
initGame() should be called before any game keymaps are added.

Definition at line 101 of file keymapper.cpp.

void Common::Keymapper::addGlobalKeymap ( Keymap keymap  ) 

Add a keymap to the global domain.

If a saved key setup exists for it in the ini file it will be used. Else, the key setup will be automatically mapped.

Transfers ownership of the keymap to the Keymapper

Definition at line 92 of file keymapper.cpp.

void Common::Keymapper::cleanupGameKeymaps (  ) 

Should be called at end of game to tell Keymapper to deactivate and free any game keymaps that are loaded.

Definition at line 130 of file keymapper.cpp.

void Common::Keymapper::clear (  ) 

Clear all the keymaps and hardware input sets.

Definition at line 52 of file keymapper.cpp.

EventType Common::Keymapper::convertStartToEnd ( EventType  eventType  )  [private]

Definition at line 350 of file keymapper.cpp.

Keymapper::IncomingEventType Common::Keymapper::convertToIncomingEventType ( const Event ev  )  const [private]

Definition at line 246 of file keymapper.cpp.

Event Common::Keymapper::executeAction ( const Action act,
const Event incomingEvent 
) [private]

Definition at line 282 of file keymapper.cpp.

HardwareInput Common::Keymapper::findHardwareInput ( const Event event  ) 

Return a HardwareInput pointer for the given event.

Definition at line 386 of file keymapper.cpp.

Keymap * Common::Keymapper::getKeymap ( const String id  )  const

Obtain a keymap of the given name from the keymapper.

Game keymaps have priority over global keymaps

Parameters:
id name of the keymap to return

Definition at line 143 of file keymapper.cpp.

const KeymapArray& Common::Keymapper::getKeymaps (  )  const [inline]

Obtain a list of all the keymaps registered with the keymapper.

Definition at line 96 of file keymapper.h.

Keymap::KeymapMatch Common::Keymapper::getMappedActions ( const Event event,
Keymap::ActionArray actions,
Keymap::KeymapType  keymapType 
) const [private]

Definition at line 225 of file keymapper.cpp.

void Common::Keymapper::hardcodedEventMapping ( Event  ev  )  [private]

Definition at line 390 of file keymapper.cpp.

void Common::Keymapper::initKeymap ( Keymap keymap,
ConfigManager::Domain domain 
)

Definition at line 114 of file keymapper.cpp.

List< Event > Common::Keymapper::mapEvent ( const Event ev  )  [virtual]

Map an incoming event to one or more action events.

Implements Common::EventMapper.

Definition at line 164 of file keymapper.cpp.

void Common::Keymapper::registerHardwareInputSet ( HardwareInputSet inputs,
KeymapperDefaultBindings backendDefaultBindings 
)

Registers a HardwareInputSet and platform-specific default mappings with the Keymapper.

Transfers ownership to the Keymapper

Definition at line 65 of file keymapper.cpp.

void Common::Keymapper::reloadAllMappings (  ) 

reload the mappings for all the keymaps from the configuration manager

Definition at line 153 of file keymapper.cpp.

void Common::Keymapper::reloadKeymapMappings ( Keymap keymap  ) 

Definition at line 124 of file keymapper.cpp.

void Common::Keymapper::resetInputState (  )  [private]

Definition at line 416 of file keymapper.cpp.

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

Enable/disable the keymapper.

Definition at line 113 of file keymapper.h.

void Common::Keymapper::setEnabledKeymapType ( Keymap::KeymapType  type  ) 

Set which kind of keymap is currently used to map events.

Keymaps with the global type are always enabled

Definition at line 159 of file keymapper.cpp.


Member Data Documentation

Definition at line 146 of file keymapper.h.

Definition at line 129 of file keymapper.h.

Definition at line 130 of file keymapper.h.

Definition at line 151 of file keymapper.h.

Definition at line 149 of file keymapper.h.


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


Generated on Sat Jul 4 2020 05:03:25 for ResidualVM by doxygen 1.7.1
curved edge   curved edge