# How to get icon for input action

**URL:** <https://forums.unrealengine.com/t/how-to-get-icon-for-input-action/672937>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine\
**Created:** [October 19, 2022, 5:53pm UTC](https://forums.unrealengine.com/t/how-to-get-icon-for-input-action/672937 "2022-10-19T17:53:09Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![MechWarrior991](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@MechWarrior991](https://forums.unrealengine.com/u/MechWarrior991)\
**Post date:** [October 19, 2022, 5:53pm UTC](https://forums.unrealengine.com/t/how-to-get-icon-for-input-action/672937/1 "2022-10-19T17:53:09Z")

</div>

Hello,

I want to show an icon for a input action. Your standard “‘E’ to Interact” type of thing.

There doesn’t _seem_ to be anything built in for this. So my thought was to use a DataTable, but I can’t figure out how to get the ‘real’ button that is mapped to an input action.

Any advice would be great, thanks!

---

<div class="post-metadata">

**Author:** ![BIGTIMEMASTER](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/bigtimemaster/32/710746_2.png) [@BIGTIMEMASTER](https://forums.unrealengine.com/u/BIGTIMEMASTER)\
**Post date:** [October 19, 2022, 5:59pm UTC](https://forums.unrealengine.com/t/how-to-get-icon-for-input-action/672937/2 "2022-10-19T17:59:43Z")

</div>

look into common UI plugin and the common action widget

---

<div class="post-metadata">

**Author:** ![Humanasset](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/humanasset/32/251551_2.png) [@Humanasset](https://forums.unrealengine.com/u/Humanasset)\
**Post date:** [October 20, 2022, 7:34am UTC](https://forums.unrealengine.com/t/how-to-get-icon-for-input-action/672937/3 "2022-10-20T07:34:56Z")

</div>

You could create an empty actor and put in a collision box and On Component Begin Overlap cast to your character and create a widget through a function in your character.

You could also set a boolean to true on the begin overlap while casting to the character so that the input action can only be ran if inside the collision through the use of a branch with said boolean. You can set it back to false and remove the widget with the On Component End Overlap so they don’t see the widget or can’t run the interact function either.

---

<div class="post-metadata">

**Author:** ![MechWarrior991](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@MechWarrior991](https://forums.unrealengine.com/u/MechWarrior991)\
**Post date:** [October 20, 2022, 5:23pm UTC](https://forums.unrealengine.com/t/how-to-get-icon-for-input-action/672937/4 "2022-10-20T17:23:54Z")

</div>

Hey, thanks for the suggestion.

It _seems_ to not have anything for actual Project Settings InputActions. Instead just UI specific input. Which this is nice, and I will for sure be using it, but it is also not what I am looking for. If I’m missing something please let me know!

---

<div class="post-metadata">

**Author:** ![MechWarrior991](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@MechWarrior991](https://forums.unrealengine.com/u/MechWarrior991)\
**Post date:** [October 20, 2022, 5:26pm UTC](https://forums.unrealengine.com/t/how-to-get-icon-for-input-action/672937/5 "2022-10-20T17:26:42Z")

</div>

Thanks for the suggestion, but what I am actually trying to do is to map and get an texture for a given input. Like if I have the “E” key mapped to the “Interact” input action. Then I could get a texture with a “E” on it. And if it is a controller it would instead get like a Xbox “X” button texture, etc.

Hope that clears up what I am wanting to do.

---

<div class="post-metadata">

**Author:** ![BIGTIMEMASTER](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/bigtimemaster/32/710746_2.png) [@BIGTIMEMASTER](https://forums.unrealengine.com/u/BIGTIMEMASTER)\
**Post date:** [October 20, 2022, 6:24pm UTC](https://forums.unrealengine.com/t/how-to-get-icon-for-input-action/672937/6 "2022-10-20T18:24:15Z")

</div>

this is what common UI solves (well one thing that it solves). What epics livestream about it, you’ll see. I also made a thread to gather resources on it, here : [Common UI Notes - Programming & Scripting / UI - Unreal Engine Forums](https://forums.unrealengine.com/t/common-ui-notes/665363/4). There is links for further resources that can be tough to find.

---

<div class="post-metadata">

**Author:** ![MechWarrior991](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@MechWarrior991](https://forums.unrealengine.com/u/MechWarrior991)\
**Post date:** [October 20, 2022, 6:50pm UTC](https://forums.unrealengine.com/t/how-to-get-icon-for-input-action/672937/7 "2022-10-20T18:50:46Z")

</div>

If you say so. But I can’t find a way to map it to the Project Setting InputActions. _Only_ the UI specific inputs that are setup in the `CommonInputActionDataBase`. Which is not what I am going for. Please let me know if there is a way that I am just missing.

---

<div class="post-metadata">

**Author:** ![BIGTIMEMASTER](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/bigtimemaster/32/710746_2.png) [@BIGTIMEMASTER](https://forums.unrealengine.com/u/BIGTIMEMASTER)\
**Post date:** [October 20, 2022, 7:21pm UTC](https://forums.unrealengine.com/t/how-to-get-icon-for-input-action/672937/8 "2022-10-20T19:21:00Z")

</div>

if you watch the video it is explained why doing it that way is beneficial (cross platform compatability)

if you want to make it match your input actions/axis by name, you’ll just have to manually enter the same names in the data table. Or you could otherwise roll your own system in which you associate an input action with a name, and pass the name to widgets, but that would be a butt-load of work to get a less robust system that you’d get with commonUI.

---

<div class="post-metadata">

**Author:** ![MechWarrior991](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@MechWarrior991](https://forums.unrealengine.com/u/MechWarrior991)\
**Post date:** [October 20, 2022, 9:18pm UTC](https://forums.unrealengine.com/t/how-to-get-icon-for-input-action/672937/9 "2022-10-20T21:18:12Z")

</div>

I appreciate you taking the time to help me with this. However I feel like one of us is misunderstanding the other in some way.

I hope this image makes it clearer what I am struggling with.

 ![CommonUIInputIssue](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/9/a/29a0022516c7c1fe37e2bea97856e7d66f52e0b6.png)

---

<div class="post-metadata">

**Author:** ![BIGTIMEMASTER](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/bigtimemaster/32/710746_2.png) [@BIGTIMEMASTER](https://forums.unrealengine.com/u/BIGTIMEMASTER)\
**Post date:** [October 20, 2022, 9:55pm UTC](https://forums.unrealengine.com/t/how-to-get-icon-for-input-action/672937/10 "2022-10-20T21:55:25Z")

</div>

ah i missed that you want runtime key rebinds.

I took a look and the Lyra project which uses commonUI has key rebinding. I dont know how they are doing it, but you could look in there and probably get some idea.

I know that it is possible to change data tables at runtime - I believe there is some blueprint plugins on marketplace but otherwise it requires some c++ from what I’ve read.

One other option - there is quite a few UI systems on the marketplace that have runtime key binding. This is accomplished in many different ways, but somewhere you end up with reference to a key and it’s associated with input action/axis. So that is all you need to select some images from.  
I would call this the simplest solution because it means you can just grab an existing, blueprint only example, and all you got to do is find the function where rebinding happens and then find a way to get that key reference and store it somewhere your widget can access. The you can make your own image switcher which just gets that reference and switches the image based on what input action you want it to represent.

---

<div class="post-metadata">

**Author:** ![Frakatchoo](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/frakatchoo/32/1060026_2.png) [@Frakatchoo](https://forums.unrealengine.com/u/Frakatchoo)\
**Post date:** [April 11, 2023, 3:06pm UTC](https://forums.unrealengine.com/t/how-to-get-icon-for-input-action/672937/11 "2023-04-11T15:06:59Z")

</div>

Do you solve your issue, I’m stuck in the same place 🙂

---

<div class="post-metadata">

**Author:** ![DMaxed](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@DMaxed](https://forums.unrealengine.com/u/DMaxed)\
**Post date:** [May 9, 2023, 4:25pm UTC](https://forums.unrealengine.com/t/how-to-get-icon-for-input-action/672937/12 "2023-05-09T16:25:26Z")

</div>

This is working for me

 ![gfdgfdgfdfds](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/6/3/d63d63939cec8dc95139eb7c01cdd2f8dc18ca5e.jpeg)

---

<div class="post-metadata">

**Author:** ![Jimi\_Dean](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Jimi\_Dean](https://forums.unrealengine.com/u/Jimi_Dean)\
**Post date:** [September 7, 2023, 10:53am UTC](https://forums.unrealengine.com/t/how-to-get-icon-for-input-action/672937/13 "2023-09-07T10:53:38Z")

</div>

Search sent me here looking for the same.  
The CommonActionWidget failed for me for displaying the KeyboardsMouse data with Enhanced Input actions.

For the icon you can use  
CommonUI-\>GetEnhancedInputActionButtonIcon()

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/0/5/2/052ff863787d2de946b167ac43220726ce8f3a94.png)

If you are in C++

```auto
CommonUI::GetIconForEnhancedInputAction(GetInputSubsystem(), EnhancedInputAction);

```

Working in current project on 5.2 with player mappable keybindings and console/controller/pc support.

---

<div class="post-metadata">

**Author:** ![Spacemarine658](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/spacemarine658/32/1194677_2.png) [@Spacemarine658](https://forums.unrealengine.com/u/Spacemarine658)\
**Post date:** [May 8, 2024, 7:23am UTC](https://forums.unrealengine.com/t/how-to-get-icon-for-input-action/672937/14 "2024-05-08T07:23:53Z")

</div>

CommonUI feels very clunky to me especially when I want runtime Keybindings so I made a tutorial on doing it without commonUI [https://youtu.be/IBlKyo0UXjM](https://youtu.be/IBlKyo0UXjM)
