ScummVM API documentation
Common::Keymapper Class Reference
Inheritance diagram for Common::Keymapper:
Common::EventMapper

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 ()
 
KeymapgetKeymap (const String &id) const
 
const KeymapArraygetKeymaps () 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)
 

Member Function Documentation

◆ mapEvent()

virtual bool Common::Keymapper::mapEvent ( const Event ev,
List< Event > &  mappedEvents 
)
virtual

Map an incoming event to one or more action events.

Implements Common::EventMapper.

◆ registerHardwareInputSet()

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

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

Transfers ownership to the Keymapper

◆ addGlobalKeymap()

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

◆ addGameKeymap()

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.

◆ cleanupGameKeymaps()

void Common::Keymapper::cleanupGameKeymaps ( )

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

◆ setGameKeymapState()

void Common::Keymapper::setGameKeymapState ( const String id,
bool  enable 
)

This allows to specify which Game Keymaps are enabled or disabled.

Parameters
idID of the game keymap to enable/disable.
enableWhether the keymap is enabled(True means enabled)

◆ disableAllGameKeymaps()

void Common::Keymapper::disableAllGameKeymaps ( )

Disables all game keymaps that are loaded.

◆ getKeymap()

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
idname of the keymap to return

◆ getKeymaps()

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

Obtain a list of all the keymaps registered with the keymapper

◆ reloadAllMappings()

void Common::Keymapper::reloadAllMappings ( )

reload the mappings for all the keymaps from the configuration manager

◆ setEnabledKeymapType()

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

◆ setEnabled()

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

Enable/disable the keymapper

◆ isEnabled()

bool Common::Keymapper::isEnabled ( ) const
inline

Return the keymapper's enabled state

◆ clear()

void Common::Keymapper::clear ( )

Clear all the keymaps and hardware input sets

◆ findHardwareInput()

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

Return a HardwareInput pointer for the given event


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