diff options
author | dec05eba <dec05eba@protonmail.com> | 2025-03-17 22:04:02 +0100 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2025-03-17 22:44:49 +0100 |
commit | a6bd165d97b657cd51ab31aa6578513db0b47b42 (patch) | |
tree | 1319aefdc78045e8a7f2a81f7cc60b909f29b0e2 /include/GlobalHotkeysJoystick.hpp | |
parent | f9e1e3ec26685fef56af9a10c153821e8b7a0273 (diff) |
Change joystick button to save replay. Add joystick buttons for more actions.
Diffstat (limited to 'include/GlobalHotkeysJoystick.hpp')
-rw-r--r-- | include/GlobalHotkeysJoystick.hpp | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/include/GlobalHotkeysJoystick.hpp b/include/GlobalHotkeysJoystick.hpp index 69f66df..7dbb272 100644 --- a/include/GlobalHotkeysJoystick.hpp +++ b/include/GlobalHotkeysJoystick.hpp @@ -3,10 +3,8 @@ #include "GlobalHotkeys.hpp" #include "Hotplug.hpp" #include <unordered_map> -#include <optional> #include <thread> #include <poll.h> -#include <mglpp/system/Clock.hpp> #include <linux/joystick.h> namespace gsr { @@ -21,6 +19,11 @@ namespace gsr { ~GlobalHotkeysJoystick() override; bool start(); + // Currently valid ids: + // save_replay + // take_screenshot + // toggle_record + // toggle_replay bool bind_action(const std::string &id, GlobalHotkeyCallback callback) override; void poll_events() override; private: @@ -45,9 +48,12 @@ namespace gsr { int event_fd = -1; int event_index = -1; - mgl::Clock double_click_clock; - std::optional<double> prev_time_clicked; + bool playstation_button_pressed = false; + bool save_replay = false; + bool take_screenshot = false; + bool toggle_record = false; + bool toggle_replay = false; int hotplug_poll_index = -1; Hotplug hotplug; }; |