How to get the key of an input action inside a context


I have tried these two methods it always gives me null except of giving like the key which i have set to “F” anyone has ideas what i can do to fix this (i am using UE 5.5.1)


I even tried this method still got “None”

Hey @UnrealGweam! Welcome to the forum!

Do you think you could try to explain a little more? I’m not quite sure what it is you’re trying to do, I thought maybe you want the mapped key but you’re saying it always gives you null except when it gives you the key? Do you think you could reword it a bit?

Thanks! :slight_smile:

Basically, i am trying to get the key of the “IA_Item_Pickup” in a name or text or a string variable because i want it more easily updated or when a player changes the controls it self updates as i use the variables for my widgets (this code is inside a custom blueprint)

i hope this explanation helps

yes i want the mapped key in a text name or string form

Does your code labeled “Get Key from the input system” Not work? What does it return? If it returns null that means nothing is mapped to it.

Try this instead, on that comment box:

no still gives me “None” not null i don’t know why


i tried this still did not work

image
i get this error

“Accessed None” is the same as “Null” :slight_smile:

So either it can’t access it or it has no buttons assigned to it. Could you show the Input Mapping context, and also show where you’re implementing it?


This is the mapping context

if your asking how i implmented it something like this ?


i did this test it said that the “enhanced input local player subsystem” has 0 number of keys. how ?

i did not know this but apparently

d
you have to add the the input mapping like this ??


I got this working but i dont know why if i hook this up to event begin play or nay other start event it just doset work and yes i also tried the “Get ref and copy” but it didnt work either


Your “Get Number of Keys” here is supposed to be for an Animation Data, which is a different understanding of what a key is, totally unrelated.

Glad you got it figured out!

Not really


i get this problem if i add a custom function other than a IA input or a event tick it comes “None”

sorry i am new to ue5 i just switched from unity so its feels weird

apparently


chatgpt fixed it and now it works thanks for all the help :smile:

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.