Fix keypad binding issue (#125)

This commit is contained in:
Kae 2024-10-08 09:49:52 +11:00
parent 1ff3072f89
commit 5db9e4e1c5

View File

@ -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();