BPC_ODK_InputComponent
is the main manager of input in the ODK. This component lives on the BP_ODK_PlayerControllerBase
asset.
Registering IMCs
BPC_ODK_InputComponent
should be configured on your player controller by adding all Input Mapping Context relevent to your game into the AllInputMappingContexts
property. This will ensure all your IMCs are registered at the start of the game.
Enabling and disabling IMCs
BPC_ODK_InputComponent
can be used to enable and disable sets of IMCs. BPC_ODK_InputComponent
uses a stack of IMC states that can be added and removed from. PushInputMappingContextState
can be used to disable all active IMCs and then activate a given set of IMCs. PushInputMappingContextState
returns an ID that can be used to remove this state from the stack when appropriate. RemoveInputMappingState
can be can be used to remove a state from the stack. When a state is removed, if it is the currently active state, all IMCs associated with the stack will be disabled and the IMCs associated with the next state in the stack will be enabled.
Getting the last input type
BPC_ODK_InputComponent
can be used to get the last input state (Gamepad/Keyboard) by calling GetLastInputType
or hooking into the event OnInputTypeUpdated
.