Download

How can i check if custom input is pressed or not?

In Project Settings -> Input, i defined a new Action Mapping called Sprint. Now in my character blueprint i want to check if this Sprint key is pressed. I can create a Get Player Controller node and wire it to Is Input Key Down but thats not i want. I mean something like Is Custom Input Key Down that lists the Action/Axis Mappings from Project Settings.

I want to post this on AnswerHub but before i do that i want to know if this is a missing feature or i am missing something.

Custom inputs are in the Input category and they’re global. :slight_smile:

6a8558b718796899f82cd1a5c746054fe54cd370.png

Since there was a problem with a forum and some posts were lost I’ll post my tutorial for once again. :slight_smile:

I understand that the hard part here is that you have one mapping associated with two different keys. Here’s what I would do:

Firstly, create an Axis Mapping and associate the keys you want with it:
897643a4cda8f04af1f5156bba7dbe0bbf096bcc.jpeg

Then you can create that blueprint:
b0abdf663bb620c961573f6f7c4c1128cbd63f82.png

Now if you want to check if any of the corresponding keys are pressed you just have to check the value of IsInputPressed variable.

I hope this is what you wanted. :smiley:

Thats what am actually doing now. I set a boolean to true if input key is pressed and set it to false when released. But i think a dedicated node like IsCustomInputKeyDown will be cool. :slight_smile:

You can always create that node yourself :smiley: