Editor: Input Events
Description
Only in blueprints inherited by the Actor
class (which includes your level blueprint). If you have a read at Unreal Engine’s architecture, its input system favours more a event-based design, rather than through conditional statements. All user/local-based input is handled by the Player Controller
class and Player Input
class.
Enabling Input in Blueprints
To use input events, make sure the class inherits from UniverseActor
or any other sub-class. The next step is to ensure you are actively receiving input from the Player
automatically in your blueprint. Make sure you select Class Defaults
in the blueprint’s toolbar, hop over to the Input
category in the details panel and AutoReceiveInput
select Player 0
:
Listening for Mouse Events
Unreal as a few Mouse
events you can add to your blueprint. You should be able to handle button-wheel and position events accordingly. For all listed mouse actions, search for Mouse Events
in your blueprint’s context menu:
Listening for Keyboard Events
Unreal is an extensive list of Keyboard
events that can be added to a level blueprint. It is possible to re-map any keyboard action to any key through the details panels - provided that the node is selected. For all listed keyboard actions, search for KeyboardEvents
in the blueprint’s context menu:
Resources
- https://docs.unrealengine.com/4.26/en-US/InteractiveExperiences/Input/
- https://docs.unrealengine.com/4.26/en-US/InteractiveExperiences/Input/SetUpInput/
- https://docs.unrealengine.com/4.26/en-US/InteractiveExperiences/Input/ActorInput/
- https://docs.unrealengine.com/4.26/en-US/InteractiveExperiences/Framework/QuickReference/
- https://docs.unrealengine.com/4.26/en-US/InteractiveExperiences/Framework/Controller/PlayerController/