diff options
author | dec05eba <dec05eba@protonmail.com> | 2025-01-04 05:39:16 +0100 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2025-01-04 05:39:16 +0100 |
commit | 52ce22ae22670b11c2bc5fac0583e1a4aa4e19f0 (patch) | |
tree | 67c6e6a02c567b45252074e2672bde6bc9ffde6f /src/main.cpp | |
parent | f379b87b33282a7d583ce5e57be684a718f6a68d (diff) |
Add option to only grab virtual devices, to support input remapping software
Diffstat (limited to 'src/main.cpp')
-rw-r--r-- | src/main.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/main.cpp b/src/main.cpp index 3cccde2..9c20a81 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -95,8 +95,8 @@ static std::unique_ptr<gsr::GlobalHotkeysX11> register_x11_hotkeys(gsr::Overlay return global_hotkeys; } -static std::unique_ptr<gsr::GlobalHotkeysLinux> register_linux_hotkeys(gsr::Overlay *overlay) { - auto global_hotkeys = std::make_unique<gsr::GlobalHotkeysLinux>(); +static std::unique_ptr<gsr::GlobalHotkeysLinux> register_linux_hotkeys(gsr::Overlay *overlay, gsr::GlobalHotkeysLinux::GrabType grab_type) { + auto global_hotkeys = std::make_unique<gsr::GlobalHotkeysLinux>(grab_type); if(!global_hotkeys->start()) fprintf(stderr, "error: failed to start global hotkeys\n"); @@ -314,8 +314,10 @@ int main(int argc, char **argv) { rpc_add_commands(rpc.get(), overlay.get()); std::unique_ptr<gsr::GlobalHotkeys> global_hotkeys = nullptr; - if(overlay->get_config().main_config.enable_hotkeys) - global_hotkeys = register_linux_hotkeys(overlay.get()); + if(overlay->get_config().main_config.hotkeys_enable_option == "enable_hotkeys") + global_hotkeys = register_linux_hotkeys(overlay.get(), gsr::GlobalHotkeysLinux::GrabType::ALL); + else if(overlay->get_config().main_config.hotkeys_enable_option == "enable_hotkeys_virtual_devices") + global_hotkeys = register_linux_hotkeys(overlay.get(), gsr::GlobalHotkeysLinux::GrabType::VIRTUAL); // TODO: Add hotkeys in Overlay when using x11 global hotkeys. The hotkeys in Overlay should duplicate each key that is used for x11 global hotkeys. |