summaryrefslogtreecommitdiff
path: root/keybinds.h
diff options
context:
space:
mode:
Diffstat (limited to 'keybinds.h')
-rw-r--r--keybinds.h34
1 files changed, 23 insertions, 11 deletions
diff --git a/keybinds.h b/keybinds.h
index d26b7a1..c0cc955 100644
--- a/keybinds.h
+++ b/keybinds.h
@@ -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;
};