From 1d9d4d6398e989d0628cb4dab0273293b79b4816 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Thu, 23 Jan 2025 21:23:19 +0100 Subject: Make hotkeys reconfigurable, faster hotkey startup time, fix some keyboard locale issues --- include/gui/GlobalSettingsPage.hpp | 46 +++++++++++++++++++++++++++++++++++++- 1 file changed, 45 insertions(+), 1 deletion(-) (limited to 'include/gui/GlobalSettingsPage.hpp') diff --git a/include/gui/GlobalSettingsPage.hpp b/include/gui/GlobalSettingsPage.hpp index 1066bb5..92454c8 100644 --- a/include/gui/GlobalSettingsPage.hpp +++ b/include/gui/GlobalSettingsPage.hpp @@ -5,18 +5,32 @@ #include "../Config.hpp" #include +#include namespace gsr { + class Overlay; class GsrPage; class PageStack; class ScrollablePage; class Subsection; class RadioButton; class Button; + class List; + class CustomRendererWidget; + + enum ConfigureHotkeyType { + NONE, + REPLAY_START_STOP, + REPLAY_SAVE, + RECORD_START_STOP, + RECORD_PAUSE_UNPAUSE, + STREAM_START_STOP, + SHOW_HIDE + }; class GlobalSettingsPage : public StaticPage { public: - GlobalSettingsPage(const GsrInfo *gsr_info, Config &config, PageStack *page_stack); + GlobalSettingsPage(Overlay *overlay, const GsrInfo *gsr_info, Config &config, PageStack *page_stack); GlobalSettingsPage(const GlobalSettingsPage&) = delete; GlobalSettingsPage& operator=(const GlobalSettingsPage&) = delete; @@ -24,21 +38,39 @@ namespace gsr { void save(); void on_navigate_away_from_page() override; + bool on_event(mgl::Event &event, mgl::Window &window, mgl::vec2f offset) override; + std::function on_startup_changed; std::function on_click_exit_program_button; std::function on_keyboard_hotkey_changed; std::function on_joystick_hotkey_changed; private: + void load_hotkeys(); + std::unique_ptr create_appearance_subsection(ScrollablePage *parent_page); std::unique_ptr create_startup_subsection(ScrollablePage *parent_page); std::unique_ptr create_enable_keyboard_hotkeys_button(); std::unique_ptr create_enable_joystick_hotkeys_button(); + std::unique_ptr create_show_hide_hotkey_options(); + std::unique_ptr create_replay_hotkey_options(); + std::unique_ptr create_record_hotkey_options(); + std::unique_ptr create_stream_hotkey_options(); + std::unique_ptr create_hotkey_control_buttons(); std::unique_ptr create_hotkey_subsection(ScrollablePage *parent_page); std::unique_ptr