Custom Input

Here, you are going to learn how to customize, change, and update your input for gamepad, keyboard, and mouse to fit your game's needs.

GamePad Input Layout

In this tutorial, you are going to learn how to customize your own gamepad layout, apply it, and set its name depending on your game's needs.

GamePadTemplate_WB

✏️ Customize Layouts Names

You're going to need to change layout names to fit the style and needs of your game, but how do you do it?

1 Reach the designer part of the widget blueprint 2 Manually select the target layout text, and modify it.

Me trying to change the recon layout name to show you how easy it is !

This would require you to update Your Localization For The New Key (It May Appear in the review Tab).

🎮 Customize Input Actions Names

The input action names in each layout are just placeholders for you to set and change them to fit your game's needs. (You've probably heard "to fit your game's needs" a lot, huh? 😉)

  1. Inside GamePadTemplate_WB reach the LayoutsSwitch Graph

  2. Inside this graph, there are 5 custom events that set all input action names. Modify them to meet your needs.

  3. At the end of each layout, there's a section to set new input rules using the built-in input library system, allowing you to change input specifically for this layout on a gamepad.

The layout variable is stored in the Game Instance and is called ControllerTemplate (of type int). Cast to your Game Instance and get its value to dynamically switch Input Mapping Contexts (IMCs) based on it inside your game mode.

Keyboard Key Mapping

🖱️ Setup Actions For Mapping

Let's set up your Actions to work with InputUserSettings—a new and convenient system by Epic that makes key rebinding easy. Open your Input Mapping Context (IMC). You should see your input actions listed there, with each action assigned to a key!

Let me break it down for you in a simple way. Inside the input action you want to include in the key mapping menu, expand one of the keys you want the user to modify (usually the keyboard one), then:

  1. Set "Setting Behavior" to Override Settings.

  2. Assign "Player Mappable Key Settings" to your PlayerMappableKeySettings class.

  3. Key Name: This is the name the widget will ask for when adding the key—make it unique and meaningful.

  4. Display Name: This is the user-friendly name that will appear in the menu for this key.

  5. Localization Flag: Enable this if you want the Display Name to be translated (localized).

For Category, leave it set to None, and disable the localization flag (the small flag icon) for this field.

🔤 Add New Input Elements

The input key mapping widget is called KeyMapping_WB, Adding your keys is very simple and easy after completing the User Input Settings steps above, now lets dive inside this widget and add our keys.

You may notice that some keys already exist.

You have two options: either delete them all or modify the existing ones. In this guide, I’ll cover how to add a new key. If you plan to modify already added elements, simply skip the step where I add the element to the widget.

This is called an Input Element just to help you understand more accurate it'sInput_Element_WB

From the Palette on the left, search for Input Element WB and drag it into the Scroll Box. You can add a Spacer with a Y size of 20 between each input element, or simply duplicate an existing one!

After adding the required number of input elements, open the Graph. Under the Event Construct node, add your new elements in order to the Input Element array.

Return to your designer tab and select each Input Element to fill it with its settings

Mapping Name refers to the Key Name we set up earlier in Step 3. Element Index is the position (order) of the selected input element—make sure it matches the same order in both the widget and the Input Element array.

The 'Search for Duplicated Key Rules' section might be a bit hard to understand at first, but it's very useful & explained below.

🎬 Exclusive Action Explained

Imagine your game has separate inputs for the player and for when the player enters a vehicle. For example, the player uses W to move forward, and the vehicle also uses W to accelerate. This would normally cause a conflict and break the key mapping menu, right?

Well, not necessarily! You can fix this by enabling Exclusive Action. This option checks whether the key the user entered is already used only within the same target category.

To set this up:

  • Assign the same category (e.g., "Vehicle") to all vehicle-related actions.

  • Enable Exclusive Action for each of them.

  • Make sure you also fill in the Target Category field.

This way, the system will prevent duplicate keys within a category, not across the entire input set—allowing you to use W for both "Move Forward" (player) and "Accelerate" (vehicle) without conflict.

This is the result after i set up my jump key as an example 👍

Last updated