From 5db9e4e1c582d39096aa9faf5f84c5aa73eb5cc9 Mon Sep 17 00:00:00 2001 From: Kae <80987908+Novaenia@users.noreply.github.com> Date: Tue, 8 Oct 2024 09:49:52 +1100 Subject: [PATCH] Fix keypad binding issue (#125) --- source/frontend/StarKeybindingsMenu.cpp | 12 ++++++++---- 1 file 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(m_activeKeybinding)->setText(buttonText); + convert(m_activeKeybinding)->setText(buttonText.join(", ")); apply(); exitActiveMode();