# Input Component

`BPC_ODK_InputComponent` is the main manager of input in the ODK. This component lives on the `BP_ODK_PlayerControllerBase` asset.&#x20;

Enabling and disabling IMCs \
`BPC_ODK_InputComponent` can be used to control which IMCs are active. `BPC_ODK_InputComponent` uses a stack of states where each state contains a set of IMCs. When a state is active, all enabled IMCs are disabled and all IMCs on the newly enalbed state are enabled.\
\
`PushInputMappingContextState` - can be used to add an new state to the stack. This state will become active.\
`RemoveInputMappingContextFromState` - can be used remove a state from the stack. The previous state in the stack will become active.\
`AddInputMappingContextToState` -  can be used to add an additional IMC to an existing state. If the state is active, the IMC will be enabled.\
`RemoveInputMappingContextFromState` - can be used to remove an IMC to an existing state. If the state is active, the IMC will be disabled.

\
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`.

{% hint style="info" %}
Note, there exists a "On Posses Input Mapping Contexts" on the base `BP_ODK_PlayerCharacterBase` . Please do not use this config. It won't work within the ODK and will be removed in a future iteration.

&#x20;![](https://33425813-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbIBFTVTQoxu1YByrB4tU%2Fuploads%2F621fb2LnBtRcVNvOIegu%2Fimage.png?alt=media\&token=78559428-724a-49fd-812b-3a934e2b4990)
{% endhint %}
