InputKeySelector with Glyph

Hello,

We have committed to supporting fully remappable gamepad inputs in our game, and need your guidance.

Our project uses the Enhanced Input System, and we have implemented mouse/keyboard and gamepad remapping in our ingame settings menu with the UInputKeySelector widget.

At present, this widget only exposes the bound input as text via: SInputKeySelector::GetSelectedKeyText() -> SelectedKey.Get().Key.GetDisplayName()

This ultimately resolves to default values such as: LOCTEXT(“Gamepad_FaceButton_Bottom”, “Gamepad Face Button Bottom”)

As EConsoleForGamepadLabels currently only contains None, XBoxOne, and PS4 , not current generation consoles (and Nintendo Switch), it returns the default case on modern consoles, resulting in generic terms like “Gamepad Face Button Bottom” being displayed on PS5 and XBOX Series X|S, which does not meet the console certification requirements.

We also reviewed the Lyra Starter Game (which appears not to have been updated since 5.3). In ULyraSettingKeyboardInput::GetKeyTextFromSlot, the logic ultimately still resolves through InputCoreTypes.h, using the same hardcoded text approach.

However, Fortnite clearly supports remappable gamepad inputs with proper controller glyphs displayed in the input selector UI. This suggests there is an internal or non-public solution in place.

Would it be possible to share:

  • The implementation (or relevant portions) of the input selector widget used in Fortnite, or
  • Guidance on the intended solution for displaying platform-appropriate controller glyphs in a widget like UInputKeySelector?

We would greatly appreciate any recommendations.

Best regards,

Sascha

[Attachment Removed]

Hi,

That EConsoleForGamepadLabels is pretty outdated, but we mostly handle platform-specific button information through CommonUI’s ControllerData. This doesn’t really help if you’re looking to display custom labels per-platform, but we just display an icon so the ControllerData lets us grab the proper icon for a given button regardless of platform/gamepad. We use this in action widgets as well for displaying key prompts. If you do need to display unique key display names that change per-platform, your best bet might be to expand out that enum with whatever platforms you need.

Best,

Cody

[Attachment Removed]

Thank you,

We made our own InputKeySelector class now. We basically started from a copy of SInputKeySelector and UInputKeySelector, replaced the TextBlock with a CommonTextBlock, wrapped it with a HorizontalBox, and added an image widget to display the icon via CommonInputPlatformSettings::Get()->TryGetInputBrush

[Attachment Removed]