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);
		((UInputSettings*)settings)->AddActionMapping(actionmapping);
	}

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:

104296-ue41.jpg

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).

regards

Simon

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 A new, community-hosted Unreal Engine Wiki - Announcements - Unreal Engine Forums