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

@@ -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();