diff options
Diffstat (limited to 'keybinds.h')
| -rw-r--r-- | keybinds.h | 34 |
1 files changed, 23 insertions, 11 deletions
@@ -1,19 +1,31 @@ #pragma once -#include <unordered_map> +#include <X11/X.h> +#include <X11/Xlib.h> +#include <map> #include <string> +#include <X11/keysym.h> +#include <vector> #include "commands.h" +struct Keybind { + KeyCode key; + unsigned int modifiers; + std::string command; +}; + class KeybindsModule { - public: - KeybindsModule(CommandsModule& commandsModule); - ~KeybindsModule() = default; - const void bind(const CommandArg* argv); - const void readBinds(const CommandArg* argv); - const void exit(const CommandArg* argv); - private: - std::unordered_map<std::string, std::string> binds; - bool exitNow; - CommandsModule& commandsModule; +public: + KeybindsModule(CommandsModule& commandsModule, Display* dpy, Window root); + ~KeybindsModule() = default; + const void bind(const CommandArg* argv); + const void exit(const CommandArg* argv); + const void handleKeypress(XKeyEvent e); +private: + std::vector<Keybind> binds; + bool exitNow; + CommandsModule& commandsModule; + Display* dpy; + Window root; }; |
