Input Detection
The Input System can automatically detect what Input Mode is being used by the player. This is useful to adjust your user interface, turn features like aim-assist on or off and so on.
Reacting to Input Mode Changes
Input Mode detection happens in the Input Manager Component. It will do so automatically, whenever an Input Action is received and processed.
Once a change is detected, it can be obtained in three ways:
Binding do the
OnInputModeChanged
delegate, available in the Input Manager Component.Calling the
GetPlayerInputMode
function, from theInputModeAwareInterface
, implemented in the Input Manager Component.Implementing the
InputModeAwareInterface
in a Player Controller, Player Pawn or Player HUD.
Input Modes are represented by Gameplay Tags. By default, the following Input Modes and Gameplay Tags are supported:
Input Mode | Gameplay Tag |
---|---|
Keyboard and Mouse |
|
Gamepad |
|
Touch |
|
Supporting Additional Input Modes
The following table can be used as a reference if you need to support additional Input Modes, or completely override the Input Mode Detection. All functions are in the Input Manager Component.
Function | Purpose |
---|---|
| Evaluates an Input Action and determines if Input Mode has changed. Can only be overridden in C++. |
| Reacts to a new Input Mode Tag, broadcasting it and forwarding to other objects. Can be override in C++ or Blueprint. |