The "pressed key" condition in the Enhanced input system

How do i recreate the “pressed key condition” from legacy input system in the UE5.1’s Enhanced input system?
image

You simply create an InputAction Object, and an Enhanced Input mapping Context. You can find both creation options when you rightclick inside your content browser and go to Input.

Inside the InputAction, you just do nothing… Cause it already is a bool.

Inside the mapping context, you add a new Mapping and select your previous created Input Action from the Selector.
As key, set the key you want. Again, don´t so anything else…


In your Blueprints, simply search for the Name of your Input Action and add that event… it has a “Started” (equals Key Pressed with that Settings) Output execution pin. Or else, use the “Triggered” output (Can fire each tick… be careful here).
The “Completed” output is the "Released"of the Key.
1

1 Like

Hello, thanks for the answer, but i don’t think you got me right. My current goal is to add an action to my character that activates when the “Shift” and the “A” key are pressed at the same time no matter in which order. Ofc i can write some logic in blueprints but in legacy system was the way to just check one of, or multiple checkboxes in the Input Menu, and i would prefer to do it like this if there is a way to do it in the new system

P.S. I see you use some sort of modification to change visuals of the Blueprint editor, mind telling me what it is?

That’s working in Enhanced Input a bit different, but much cleaner…

You want to set a “Chorded Action” as a trigger.
5

The Chorded Action lets you select a second Action in its Setup. So, this InputAction only triggers, when the chorded action is triggered first.
You can add as many Triggers or modifiers as you want.

About the Visual of my Editor:
Two Plugins:
Flat Nodes and Node Graph Assistant

1 Like

Hey @RTELOS! Welcome to the forums! :smiley:

@BDC_Patrick is right! I also found this other thread where the OP went through the trouble to make a small walkthrough of how to do exactly what you’re wanting, they just used ALT instead of Shift :slight_smile: It says C++ but it’s Blueprint.

1 Like

Thank you so much, i did a quick test and it works like a dream. Actually i was about to find the right way myself but chose the “Combo” trigger instead of the “Chorded Action”. Also ty for plugin info

Chorded Actions are meant to be used with things gameplay related, hence the sneaking example. If one wants to enable SHIFT W but let a custom remapping take place, there doesn’t seem to be a clean way to do that.

It’s astounding that using this system we cannot let our players use key modifiers as they desire. Instead of simply changing the key when remapping, one needs to create/delete a whole chorded action depending on the choices of the user.

Doesn’t sound cleaner to me.

3 Likes