Download

Set label for an Input Key Selector widget.

I implemented a key remapping in UE 4.21 with an input key selector as a widget listening for the new keys input. However when using a gamepad input I have names like “GamePad Left Thumbstick Y-Axis” showing in my settings, hence the input key selector becomes quite large. I wanted to know if it’s possible to either replace the name of the input key with a label or, it would be even better, if it’s possible to have a small image instead. For instance when it’s left thumstick I would have an image of a left thumbstick with a L written on it.

I know this post is a bit old, but I thought I’d try help anybody having trouble with this.

Wrap the input key selector in a canvas panel and size it how you want it make sure the selector is set to fill. Set the selector’s render opacity to 0 (Do that instead of making it hidden, cause it still needs to be hit-testable).

You’ll then want to add a border to that canvas panel, then add a text child to the border. Make both of these non-hit-testable, but still visible.

Make a map of strings as key and strings as value. In that map, you’ll make a key for each of the input names, and in the value, type what you want to be displayed instead. Bind this to your text render by breaking the input chord and getting the key’s display name, convert it to string, and then ‘find’ it in your map and return the relevant value. That returned value should be the text that your text block displays.

There’s more you can do to make it feel as responsive as (or moreso than) the input key selector. But that’s how you could do this without building from source.

1 Like