Add controller hotkey to show/hide ui

This commit is contained in:
dec05eba
2025-03-20 19:22:16 +01:00
parent 71b6c395ca
commit a0d8af9d37
8 changed files with 25 additions and 2 deletions

View File

@@ -272,7 +272,7 @@ namespace gsr {
static void bind_linux_hotkeys(GlobalHotkeysLinux *global_hotkeys, Overlay *overlay) {
global_hotkeys->bind_key_press(
config_hotkey_to_hotkey(overlay->get_config().main_config.show_hide_hotkey),
"show_hide", [overlay](const std::string &id) {
"toggle_show", [overlay](const std::string &id) {
fprintf(stderr, "pressed %s\n", id.c_str());
overlay->toggle_show();
});
@@ -334,6 +334,11 @@ namespace gsr {
if(!global_hotkeys_js->start())
fprintf(stderr, "Warning: failed to start joystick hotkeys\n");
global_hotkeys_js->bind_action("toggle_show", [overlay](const std::string &id) {
fprintf(stderr, "pressed %s\n", id.c_str());
overlay->toggle_show();
});
global_hotkeys_js->bind_action("save_replay", [overlay](const std::string &id) {
fprintf(stderr, "pressed %s\n", id.c_str());
overlay->save_replay();