Download

How to reference a mapped input?

How would I reference an input? For example, If the reload action in my game is mapped to an input action called reload, and the key is mapped to R, how to reference that in blueprint?

i think this is best you can get now:

Can this plugin be used in a blueprint project?

I don’t know how how that is even related to the topic.

If your input action is calles reload then you should be able to create a node calles “Input Action Reload” or something similar to that. Just type in the name of the input and it should show up eventually.

So far I found InputActionKeyMapping (break node), but not sure what input it can take. And KeyGetDisplayName, which correctly displays the name of the key that was pressed when the inputaction was fired. But I would like to reference that without having to press the key first. GetKeyThatIsMappedToTheInputAction is what I want.

Okay so if I understand you correctly you want to have an action mapping with multiple keys assigned to it and you wanna know which key was used for it?

91b2c930cd67aea029b5c976d23c795e3ac2ffa3.png

Okay so here I build a small example. You have the action mapping “Reload” which is triggered with the keys R, Q and E.

In your blueprint you just add the “Input Action Releoad” and there you see the little output named “Key”. This should output the actual key that was pressed. no matter which of the 3 keys was used.

Interestingly enough, I guess you could build a reload system and have multiple types of reloading depending on which key was pressed, that’d be something new. :smiley:

Thanks but that is not what I am looking for. I would like to get the information on what key is assigned to an inputaction, without having to press it first. I want to use it for an on screen hint, “press [Key] to reload”.

Well if you would’ve just said that from the beginning we could’ve avoided a lot of confusion…
Sadly I don’t know how to do that. Sorry.

Oh i read (somehow) that you want to do it in runtime.
For static referencing just like those folks wrote above.
There are 2 versions of Axis input (analog pads etc). You can either get it as event, or you can get values as function.

I don’t get what you mean.

That’s not what he means. Let’s take my example.

He wants something that will tell the player “Press [R] to reload.” but he wants to grab what was set in the input settings so that if someone changes the key binding it’ll say “Press [Q] to reload.” instead.

At least that’s what I got from it… :smiley:

Yes that is what I meant. Getting the assigned key after an action is fired is working, but I have no idea how to get the assigned input without it.

There is no way, in Blueprints, to get the key(s) mapped to a certain input, unfortunately. Easy Input Remapping (A plugin, linked in my signature), will allow you to do just that.