Custom key bindings

Hey, I’ve been trying to find a good tutorial on how to setup custom key bindings on my settings widget but I haven’t been able to find any, I want to create a settings for both the keyboard and gamepad which allows the player to choose whatever key they’d like to do certain actions… If you can help, it’ll be appreciated.

I’m not sure why you’re having trouble- every keybind tutorial should go over this.
Using the new or old system, you can just add both the keyboard and gamepad controls, and use the input key selector.

You can just have one widget tab for keyboard inputs and one for gamepad.

That’s the idea I wanna work on, regardless I don’t know what and what I need to do to achieve it, I’ve already created the widget, I just need the codes

Yup- that is what gamedev is. You’ll need to make the code.

The easiest way to separate them is probably to check if the key display name has gamepad in it:




Here’s a tutorial on the basics of the enhanced input action system:

Thanks, this also applys to ue4 right?

Yup- though you’ll need to enable the enhanced input plugin.

The default system in UE4 is deprecated in UE5, so I’d recommend using the enhanced version- it’s also the system I actually sent a tutorial for.

Alright thanks, I’m gonna try to do it following the steps on the tutorial

for keyboard + gamepad tabs the pattern that works is one Input Key Selector per action per device row, read Query Keys Mapped to Action and split by device (gamepad keys have Gamepad in the display name or check IsGamepadKey). capture with the selector, then Map Player Key / Add Player Mapped Key In Slot and SaveSettings so it persists. biggest gotcha is Map Key drops modifiers and triggers, so copy the old mapping options into the new one.

if you dont want to build all that, Advanced Input Rebinding System, a runtime key-rebinding system for Unreal Engine 5, ships the capture flow + conflict detection + save profiles: Advanced Input Rebinding System. its on sale right now ($32.71).