diff options
author | dec05eba <dec05eba@protonmail.com> | 2024-11-30 22:25:58 +0100 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2024-11-30 22:26:56 +0100 |
commit | 6cde892148e2643a3cd1ba80c3669bc035fc1fea (patch) | |
tree | 401a4927b79bb9bddfce977d5f51b0dca472f789 /include/GlobalHotkeysX11.hpp | |
parent | f885ae67f13ab26dcc47d3fa9cc31ee2fea58c50 (diff) |
Use X11 global hotkeys on X11 when possible to prevent clashing with keys used by other applications
Diffstat (limited to 'include/GlobalHotkeysX11.hpp')
-rw-r--r-- | include/GlobalHotkeysX11.hpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/include/GlobalHotkeysX11.hpp b/include/GlobalHotkeysX11.hpp index 427e9f0..610399a 100644 --- a/include/GlobalHotkeysX11.hpp +++ b/include/GlobalHotkeysX11.hpp @@ -12,12 +12,15 @@ namespace gsr { GlobalHotkeysX11& operator=(const GlobalHotkeysX11&) = delete; ~GlobalHotkeysX11() override; + // Hotkey key is a KeySym (XK_z for example) and modifiers is a bitmask of X11 modifier masks (for example ShiftMask | Mod1Mask) bool bind_key_press(Hotkey hotkey, const std::string &id, GlobalHotkeyCallback callback) override; void unbind_key_press(const std::string &id) override; void unbind_all_keys() override; void poll_events() override; + bool on_event(mgl::Event &event) override; private: - void call_hotkey_callback(Hotkey hotkey) const; + // Returns true if a key bind has been registered for the hotkey + bool call_hotkey_callback(Hotkey hotkey) const; private: struct HotkeyData { Hotkey hotkey; |