Keyboard Events or Input Key Events | Unreal Engine Blueprints

In this blog post, we’ll go over the basics of keyboard events in Unreal Engine and how they can be used in Blueprints.

How to use Keyboard Events in Unreal Engine?

Using keyboard events in Unreal Engine Blueprints is a simple process. Here are the steps to follow:

  1. Right click in the Blueprint Event Graph
  2. Search for “Keyboard“, or look for “Input → “Keyboard Events”
  3. Finally, choose the key you want to use to start an event.
  4. Another option is to search directly for the key you want, like “F keyboard,” instead of scrolling through the entire list.
  5. All of the keys on the keyboard are listed in the dropdown list.
Unreal Engine Keyboard Events

Input Key: Pressed vs Released

When a key is “Pressed,” it means the user has physically pushed it down but it has not yet been released. Unreal Engine detects this action and activates the appropriate keyboard output.

When a key is “Released,” it means that the user has let go of the key and it returns to its original position. This will activate the keyboard Released output.

Keyboard events for both “pressed” and “released” states can be captured separately in Unreal Engine. This enables game developers to create more complex gameplay mechanics that respond differently to specific keyboard inputs. A game, for example, could use a “pressed” event to cause a character to jump and a “released” event to cause the character to perform a special move in mid-air.

Understanding the difference between “pressed” and “released” events is critical for developing responsive and engaging gameplay mechanics that are intuitive to the player.

To test the difference inside the engine, try connecting a Print String node to the pressed and release inputs.

Why is the Key Event Not Working?

If you try to use a Keyboard Event in a Blueprint actor other than your character or pawn, you may run into problems.

It is possible that the Key Event won’t execute. But why is that?

In general, I wouldn’t recommend enabling input on an actor that you don’t possess because there is usually a better solution that doesn’t cause problems with multiple actors.

But here are three potential solutions to this problem that you can try:

SOLUTION 1

  • Connect the Event BeginPlay to an Enable Input node. This will enable input on the blueprint.
  • Remember to connect the ‘Get Player Controller‘ node as well.
Unreal Engine Enable Key Event Input

SOLUTION 2

  • Change “Auto Receive Input” from “Disabled” to “Player 0” inside the Blueprint’s details panel.
Unreal Engine Auto Receive Input

SOLUTION 3

  • Just check that the Blueprint is active on the level and that appears in the Outliner. This may appear overly simple, but it is a common error.

More keys using the same input?

Click in the Keyboard Event Node and look at the details panel, you’ll see the “Consume Input” option.

If checked, it stops the actor with the lowest priority from handling this input.

In case you have input conflicts due to numerous inputs utilizing the same key, be sure to check or uncheck this option based on your needs.

Unreal Engine Roadmap