Public Member Functions | |
Keymapper (EventManager *eventMan) | |
virtual bool | mapEvent (const Event &ev, List< Event > &mappedEvents) |
void | registerHardwareInputSet (HardwareInputSet *inputs, KeymapperDefaultBindings *backendDefaultBindings) |
void | addGlobalKeymap (Keymap *keymap) |
void | addGameKeymap (Keymap *keymap) |
void | cleanupGameKeymaps () |
void | setGameKeymapState (const String &id, bool enable) |
void | disableAllGameKeymaps () |
Keymap * | getKeymap (const String &id) const |
const KeymapArray & | getKeymaps () const |
void | reloadAllMappings () |
void | setEnabledKeymapType (Keymap::KeymapType type) |
Keymap::KeymapType | enabledKeymapType () const |
void | setEnabled (bool enabled) |
bool | isEnabled () const |
void | clear () |
HardwareInput | findHardwareInput (const Event &event) |
void | initKeymap (Keymap *keymap, ConfigManager::Domain *domain) |
void | reloadKeymapMappings (Keymap *keymap) |
Map an incoming event to one or more action events.
Implements Common::EventMapper.
void Common::Keymapper::registerHardwareInputSet | ( | HardwareInputSet * | inputs, |
KeymapperDefaultBindings * | backendDefaultBindings | ||
) |
Registers a HardwareInputSet and platform-specific default mappings with the Keymapper
Transfers ownership to the Keymapper
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
void Common::Keymapper::addGameKeymap | ( | Keymap * | keymap | ) |
Add a keymap to the game domain.
Transfers ownership of the keymap to the Keymapper
void Common::Keymapper::cleanupGameKeymaps | ( | ) |
Should be called at end of game to tell Keymapper to deactivate and free any game keymaps that are loaded.
void Common::Keymapper::setGameKeymapState | ( | const String & | id, |
bool | enable | ||
) |
This allows to specify which Game Keymaps are enabled or disabled.
id | ID of the game keymap to enable/disable. |
enable | Whether the keymap is enabled(True means enabled) |
void Common::Keymapper::disableAllGameKeymaps | ( | ) |
Disables all game keymaps that are loaded.
Obtain a keymap of the given name from the keymapper. Game keymaps have priority over global keymaps
id | name of the keymap to return |
|
inline |
Obtain a list of all the keymaps registered with the keymapper
void Common::Keymapper::reloadAllMappings | ( | ) |
reload the mappings for all the keymaps from the configuration manager
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
|
inline |
Enable/disable the keymapper
|
inline |
Return the keymapper's enabled state
void Common::Keymapper::clear | ( | ) |
Clear all the keymaps and hardware input sets
HardwareInput Common::Keymapper::findHardwareInput | ( | const Event & | event | ) |
Return a HardwareInput pointer for the given event