diff options
author | Kae <80987908+Novaenia@users.noreply.github.com> | 2024-10-08 09:49:52 +1100 |
---|---|---|
committer | Kae <80987908+Novaenia@users.noreply.github.com> | 2024-10-08 09:49:52 +1100 |
commit | 5db9e4e1c582d39096aa9faf5f84c5aa73eb5cc9 (patch) | |
tree | c409ae8e8e145f7ec5f98f47bbca02e763196e3a /source/frontend/StarKeybindingsMenu.cpp | |
parent | 1ff3072f89c6c88cb5d6963cc031d232d51badf0 (diff) |
Fix keypad binding issue (#125)
Diffstat (limited to 'source/frontend/StarKeybindingsMenu.cpp')
-rw-r--r-- | source/frontend/StarKeybindingsMenu.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/source/frontend/StarKeybindingsMenu.cpp b/source/frontend/StarKeybindingsMenu.cpp index c07dae8..b532ca9 100644 --- a/source/frontend/StarKeybindingsMenu.cpp +++ b/source/frontend/StarKeybindingsMenu.cpp @@ -180,14 +180,18 @@ void KeybindingsMenu::setKeybinding(KeyChord desc) { config->set("bindings", base); - String buttonText; + StringList buttonText; for (auto const& entry : base.get(key).iterateArray()) { - auto stored = inputDescriptorFromJson(entry); - buttonText = String::joinWith(", ", buttonText, printInputDescriptor(stored)); + try { + auto stored = inputDescriptorFromJson(entry); + buttonText.push_back(printInputDescriptor(stored)); + } catch (StarException const& e) { + buttonText.push_back("unknown"); + } } - convert<ButtonWidget>(m_activeKeybinding)->setText(buttonText); + convert<ButtonWidget>(m_activeKeybinding)->setText(buttonText.join(", ")); apply(); exitActiveMode(); |