Related: CryInput
For information on controller mapping, head over to the documentation here: Setting Up Controls and Action Maps
The Action Maps Manager provide an high-level interface to handle input controls inside a game. The Action Maps System is implemented in CryAction, and can be used directly by any code inside CryAction or the GameDLL.
The Action Map Manager is initialized during the initialization of CryAction.
We simplified the initialization process by moving most of the code into the Action Map Manager itself, so the Game just has to provide the path for the defaultProfile.xml (default path is Game/Libs/Config/defaultProfile.xml).
This can be done by simply passing the path to the manager like this:
IActionMapManager* pActionMapManager = m_pFramework->GetIActionMapManager();
if (pActionMapManager)
{
pActionMapManager->InitActionMaps(filename);
}
Note: The ActionMapManager will clear all existing initialized maps, filters and controller layouts on initialization.
If you have other systems in place that need to know about action map events, you can subscribe to the ActionMapManager events through an IActionMapEventListener. The following events are currently available:
It is required to enable each Action Map because being able to receive the actions. It's possible to enable or disable individual Action Map at any time during run-time.
The following code:
pActionMapMan->EnableActionMap("default", true);
To receive Actions, it's required to implement the IActionListener interface in a class.