mirror of
https://repo.dec05eba.com/gpu-screen-recorder-ui
synced 2026-03-31 09:17:04 +09:00
Add hotkey for region/window recording
This commit is contained in:
12
src/main.cpp
12
src/main.cpp
@@ -56,7 +56,7 @@ static void rpc_add_commands(gsr::Rpc *rpc, gsr::Overlay *overlay) {
|
||||
|
||||
rpc->add_handler("toggle-record", [overlay](const std::string &name) {
|
||||
fprintf(stderr, "rpc command executed: %s\n", name.c_str());
|
||||
overlay->toggle_record();
|
||||
overlay->toggle_record(gsr::RecordForceType::NONE);
|
||||
});
|
||||
|
||||
rpc->add_handler("toggle-pause", [overlay](const std::string &name) {
|
||||
@@ -64,6 +64,16 @@ static void rpc_add_commands(gsr::Rpc *rpc, gsr::Overlay *overlay) {
|
||||
overlay->toggle_pause();
|
||||
});
|
||||
|
||||
rpc->add_handler("toggle-record-region", [overlay](const std::string &name) {
|
||||
fprintf(stderr, "rpc command executed: %s\n", name.c_str());
|
||||
overlay->toggle_record(gsr::RecordForceType::REGION);
|
||||
});
|
||||
|
||||
rpc->add_handler("toggle-record-window", [overlay](const std::string &name) {
|
||||
fprintf(stderr, "rpc command executed: %s\n", name.c_str());
|
||||
overlay->toggle_record(gsr::RecordForceType::WINDOW);
|
||||
});
|
||||
|
||||
rpc->add_handler("toggle-stream", [overlay](const std::string &name) {
|
||||
fprintf(stderr, "rpc command executed: %s\n", name.c_str());
|
||||
overlay->toggle_stream();
|
||||
|
||||
Reference in New Issue
Block a user