Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

How do I map a Gamepad Button to an Action?

Hi guys (and girls),

See the title for my question. My current approach is this:

 for (FName keyName : inputKeys) {
         const UInputSettings* settings = GetDefault<UInputSettings>();
         FInputActionKeyMapping actionmapping(name, FKey(keyName), false, false, false, false);

Which does the trick for keyboard inputs. But If I pass "Gamepad Face Button Right" as the keyName it doesn't work. I can see in the Inputsettings, that the key is still added, but it does simply not fire the action. Also: The icon suggests it gets added as a keyboard key instead of a gamepad button as shown here:

alt text

I added the upper one with the correct icon manually, and that one works. I have no idea what I'm doing wrong (and since the documentation doesn't really cover creating inputs in C++ it's not a big help).



Product Version: UE 4.12
ue41.jpg (15.4 kB)
more ▼

asked Aug 25 '16 at 12:36 PM in C++ Programming

avatar image

1.3k 46 29 59

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

Ok, I solved it myself. It was pretty stupid. I was using the key names the editor was showing. however the names are different in-code. They can be found here https://wiki.unrealengine.com/List_of_Key/Gamepad_Input_Names

more ▼

answered Aug 25 '16 at 05:12 PM

avatar image

1.3k 46 29 59

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question