Add hotkey for region/window recording

This commit is contained in:
dec05eba
2026-01-19 22:26:03 +01:00
parent 0269387b9a
commit 5f484bd82c
10 changed files with 153 additions and 38 deletions

View File

@@ -129,6 +129,8 @@ namespace gsr {
std::string container = "mp4";
ConfigHotkey start_stop_hotkey;
ConfigHotkey pause_unpause_hotkey;
ConfigHotkey start_stop_region_hotkey;
ConfigHotkey start_stop_window_hotkey;
};
struct ReplayConfig {

View File

@@ -49,6 +49,12 @@ namespace gsr {
ERROR,
};
enum class RecordForceType {
NONE,
REGION,
WINDOW
};
enum class ScreenshotForceType {
NONE,
REGION,
@@ -74,7 +80,7 @@ namespace gsr {
void show();
void hide_next_frame();
void toggle_show();
void toggle_record();
void toggle_record(RecordForceType force_type);
void toggle_pause();
void toggle_stream();
void toggle_replay();
@@ -151,7 +157,7 @@ namespace gsr {
void on_press_save_replay_1_min_replay();
void on_press_save_replay_10_min_replay();
bool on_press_start_replay(bool disable_notification, bool finished_selection);
void on_press_start_record(bool finished_selection);
void on_press_start_record(bool finished_selection, RecordForceType force_type);
void on_press_start_stream(bool finished_selection);
void on_press_take_screenshot(bool finished_selection, ScreenshotForceType force_type);
bool update_compositor_texture(const Monitor &monitor);

View File

@@ -26,6 +26,8 @@ namespace gsr {
REPLAY_SAVE_10_MIN,
RECORD_START_STOP,
RECORD_PAUSE_UNPAUSE,
RECORD_START_STOP_REGION,
RECORD_START_STOP_WINDOW,
STREAM_START_STOP,
TAKE_SCREENSHOT,
TAKE_SCREENSHOT_REGION,
@@ -61,6 +63,7 @@ namespace gsr {
std::unique_ptr<List> create_replay_hotkey_options();
std::unique_ptr<List> create_replay_partial_save_hotkey_options();
std::unique_ptr<List> create_record_hotkey_options();
std::unique_ptr<List> create_record_hotkey_window_region_options();
std::unique_ptr<List> create_stream_hotkey_options();
std::unique_ptr<List> create_screenshot_hotkey_options();
std::unique_ptr<List> create_screenshot_region_hotkey_options();
@@ -100,6 +103,8 @@ namespace gsr {
Button *save_replay_10_min_button_ptr = nullptr;
Button *start_stop_recording_button_ptr = nullptr;
Button *pause_unpause_recording_button_ptr = nullptr;
Button *start_stop_recording_region_button_ptr = nullptr;
Button *start_stop_recording_window_button_ptr = nullptr;
Button *start_stop_streaming_button_ptr = nullptr;
Button *take_screenshot_button_ptr = nullptr;
Button *take_screenshot_region_button_ptr = nullptr;