From 6cde892148e2643a3cd1ba80c3669bc035fc1fea Mon Sep 17 00:00:00 2001 From: dec05eba Date: Sat, 30 Nov 2024 22:25:58 +0100 Subject: Use X11 global hotkeys on X11 when possible to prevent clashing with keys used by other applications --- include/GlobalHotkeys.hpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'include/GlobalHotkeys.hpp') diff --git a/include/GlobalHotkeys.hpp b/include/GlobalHotkeys.hpp index 662113e..27fca07 100644 --- a/include/GlobalHotkeys.hpp +++ b/include/GlobalHotkeys.hpp @@ -4,6 +4,10 @@ #include #include +namespace mgl { + class Event; +} + namespace gsr { struct Hotkey { uint64_t key = 0; @@ -24,5 +28,7 @@ namespace gsr { virtual void unbind_all_keys() {} virtual bool bind_action(const std::string &id, GlobalHotkeyCallback callback) { (void)id; (void)callback; return false; }; virtual void poll_events() = 0; + // Returns true if the event wasn't consumed (if the event didn't match a key that has been bound) + virtual bool on_event(mgl::Event &event) { (void)event; return true; } }; } \ No newline at end of file -- cgit v1.2.3