The engine uses the Enhanced Input plugin to handle user interactions with the keyboard, mouse, gamepad, etc. When you press a button, such as the spacebar, it sends the corresponding event for that key, for example, a jump, to the classes that want to receive these events, typically a player controller or a pawn. It’s up to you to configure the Input Mapping Context (the input action used) and the Input Actions (the key corresponding to an action).
In the case of a touch interface, there are only Touch events (Touch Press, Touch Move, Touch End). We could retrieve these events and call the desired functions in the player controller or pawn, but this isn’t practical. To maintain consistency regarding inputs throughout the project, we use the input injection feature of the Enhanced Input plugin. This allows us to signal to the engine that there is user interaction, for example, the action of jumping (spacebar) when your finger has simply touched the screen.
With this method, we can simulate interaction with the keyboard, mouse, or gamepad.
