aboutsummaryrefslogtreecommitdiff
path: root/src/Overlay.cpp
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2025-03-20 19:22:16 +0100
committerdec05eba <dec05eba@protonmail.com>2025-03-20 19:22:16 +0100
commita0d8af9d372ac3847cbae9dc9c647abf57227e3c (patch)
treea9bf3be57410b3d2202ff28b24ffa209c08800b4 /src/Overlay.cpp
parent71b6c395ca868a3c138585d05bcb72041c294cb3 (diff)
Add controller hotkey to show/hide ui
Diffstat (limited to 'src/Overlay.cpp')
-rw-r--r--src/Overlay.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/Overlay.cpp b/src/Overlay.cpp
index 63f9822..0be7375 100644
--- a/src/Overlay.cpp
+++ b/src/Overlay.cpp
@@ -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();