mirror of
https://repo.dec05eba.com/gpu-screen-recorder-ui
synced 2026-03-31 09:17:04 +09:00
Add lshift + printscreen hotkey to take a screenshot of a window (or desktop portal on wayland)
This commit is contained in:
@@ -145,6 +145,7 @@ namespace gsr {
|
||||
std::string save_directory;
|
||||
ConfigHotkey take_screenshot_hotkey;
|
||||
ConfigHotkey take_screenshot_region_hotkey;
|
||||
ConfigHotkey take_screenshot_window_hotkey; // Or desktop portal, on wayland
|
||||
};
|
||||
|
||||
struct Config {
|
||||
|
||||
@@ -41,6 +41,12 @@ namespace gsr {
|
||||
SCREENSHOT
|
||||
};
|
||||
|
||||
enum class ScreenshotForceType {
|
||||
NONE,
|
||||
REGION,
|
||||
WINDOW
|
||||
};
|
||||
|
||||
class Overlay {
|
||||
public:
|
||||
Overlay(std::string resources_path, GsrInfo gsr_info, SupportedCaptureOptions capture_options, egl_functions egl_funcs);
|
||||
@@ -64,6 +70,7 @@ namespace gsr {
|
||||
void save_replay_10_min();
|
||||
void take_screenshot();
|
||||
void take_screenshot_region();
|
||||
void take_screenshot_window();
|
||||
void show_notification(const char *str, double timeout_seconds, mgl::Color icon_color, mgl::Color bg_color, NotificationType notification_type, const char *capture_target = nullptr);
|
||||
bool is_open() const;
|
||||
bool should_exit(std::string &reason) const;
|
||||
@@ -121,7 +128,7 @@ namespace gsr {
|
||||
bool on_press_start_replay(bool disable_notification, bool finished_selection);
|
||||
void on_press_start_record(bool finished_selection);
|
||||
void on_press_start_stream(bool finished_selection);
|
||||
void on_press_take_screenshot(bool finished_selection, bool force_region_capture);
|
||||
void on_press_take_screenshot(bool finished_selection, ScreenshotForceType force_type);
|
||||
bool update_compositor_texture(const Monitor &monitor);
|
||||
|
||||
std::string get_capture_target(const std::string &capture_target, const SupportedCaptureOptions &capture_options);
|
||||
|
||||
@@ -29,6 +29,7 @@ namespace gsr {
|
||||
STREAM_START_STOP,
|
||||
TAKE_SCREENSHOT,
|
||||
TAKE_SCREENSHOT_REGION,
|
||||
TAKE_SCREENSHOT_WINDOW,
|
||||
SHOW_HIDE
|
||||
};
|
||||
|
||||
@@ -63,6 +64,7 @@ namespace gsr {
|
||||
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();
|
||||
std::unique_ptr<List> create_screenshot_window_hotkey_options();
|
||||
std::unique_ptr<List> create_hotkey_control_buttons();
|
||||
std::unique_ptr<Subsection> create_keyboard_hotkey_subsection(ScrollablePage *parent_page);
|
||||
std::unique_ptr<Subsection> create_controller_hotkey_subsection(ScrollablePage *parent_page);
|
||||
@@ -99,6 +101,7 @@ namespace gsr {
|
||||
Button *start_stop_streaming_button_ptr = nullptr;
|
||||
Button *take_screenshot_button_ptr = nullptr;
|
||||
Button *take_screenshot_region_button_ptr = nullptr;
|
||||
Button *take_screenshot_window_button_ptr = nullptr;
|
||||
Button *show_hide_button_ptr = nullptr;
|
||||
|
||||
ConfigHotkey configure_config_hotkey;
|
||||
|
||||
Reference in New Issue
Block a user