UMG text using controller buttons

When I design the menus in my game with UMG, I would sometimes need to label actions that are doable by some controller buttons if a player is using a controller.

If I’m using an Xbox controller and some action is assigned to the A button I’d want to display an A. And if someone isn’t using an Xbox controller but instead some other controller I’d want to display Button 0 or something.

Is there a nice generic way to display controller buttons as text? I’ve heard of some games doing this as part of the font using special characters. It would be really nice, especially, if this is already built into Unreal Engine 4.

Here’s a screenshot example:

You could forward the xbox button press from your playercontroller to your umg. Im not sure if there is an equivalent to the keydown event but it wouldnt take more than 30 minutes to setup every available button press to be displayed on screen. If I find something i’ll let you know.

I meant for actually displaying buttons in the UI.

As an example I want a string like this to show up if someone was using an Xbox 360 Controller: (X) Accept (B) Cancel

And if I detect they are using a PS4 controller or something I’d show PS4 buttons. And if it’s a generic controller I’d show like Button 1 or something.

I’ve heard of games using special characters to display buttons as part of the text itself because it was part of the font. So my string may look something like &xboxX& Accept and it would interpret &xboxX& as a character in my font for the X button on an xbox controller.

I was just wondering if something like this was built into UE4 already.