1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-09-30 19:22:14 +00:00

Implement secondary keybindings

This commit is contained in:
y5nw 2025-03-23 21:55:45 +01:00 committed by y5nw
parent 4f42b4308c
commit f767a7a529
7 changed files with 51 additions and 25 deletions

View file

@ -212,11 +212,11 @@ static KeyPress id_to_keypress(touch_gui_button_id id)
auto setting_name = id_to_setting(id);
assert(!setting_name.empty());
auto kp = getKeySetting(setting_name);
if (!kp)
const auto &keylist = getKeySetting(setting_name);
if (keylist.empty())
warningstream << "TouchControls: Unbound or invalid key for "
<< setting_name << ", hiding button." << std::endl;
return kp;
return keylist[0];
}