Get the key value of an input action


I want to create a system where it displays for example: [E] to interact with door
It differs depending on the item, which I’ve worked out using interfaces, but the E must adapt to whatever the player sets their input key as. How do I access the value of this input action and turn it into a string?


1 Like

This is how you could get the key of a specific input action in a specific context:

Here’s another way:


This worked for me.

1 Like

It returns the key with the “0”, so if in Input Mapping Context you have first Input Action as mouse/keyboard and second as gamepad: just drag off from “key” → “is input key down” to make sure which was actully pressed.