aboutsummaryrefslogtreecommitdiff
path: root/include/GlobalHotkeys.hpp
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2024-11-30 22:25:58 +0100
committerdec05eba <dec05eba@protonmail.com>2024-11-30 22:26:56 +0100
commit6cde892148e2643a3cd1ba80c3669bc035fc1fea (patch)
tree401a4927b79bb9bddfce977d5f51b0dca472f789 /include/GlobalHotkeys.hpp
parentf885ae67f13ab26dcc47d3fa9cc31ee2fea58c50 (diff)
Use X11 global hotkeys on X11 when possible to prevent clashing with keys used by other applications
Diffstat (limited to 'include/GlobalHotkeys.hpp')
-rw-r--r--include/GlobalHotkeys.hpp6
1 files changed, 6 insertions, 0 deletions
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 <functional>
#include <string>
+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