summaryrefslogtreecommitdiff
path: root/keybinds.h
diff options
context:
space:
mode:
authorBossCode45 <human.cyborg42@gmail.com>2023-06-19 12:49:19 +1200
committerBossCode45 <human.cyborg42@gmail.com>2023-06-19 12:49:19 +1200
commit8b4b487e685c72a478baf74aea2bf756988fe550 (patch)
tree9a5ac8ffbd65942f4ce0117a5316f7db7f4eb918 /keybinds.h
parent6655d5dfb24ca3fd36b02550c526bca1f5d924e9 (diff)
parent185015b39b8db953b8034f29724ef03de09e7ea1 (diff)
downloadYATwm-8b4b487e685c72a478baf74aea2bf756988fe550.tar.gz
YATwm-8b4b487e685c72a478baf74aea2bf756988fe550.zip
Merge branch 'config-refactor'
Merging in the new config system with commands
Diffstat (limited to 'keybinds.h')
-rw-r--r--keybinds.h33
1 files changed, 33 insertions, 0 deletions
diff --git a/keybinds.h b/keybinds.h
new file mode 100644
index 0000000..686eaf8
--- /dev/null
+++ b/keybinds.h
@@ -0,0 +1,33 @@
+#pragma once
+
+#include <X11/X.h>
+#include <X11/Xlib.h>
+#include <map>
+#include <string>
+#include <X11/keysym.h>
+#include <vector>
+
+#include "commands.h"
+#include "config.h"
+#include "util.h"
+
+struct Keybind {
+ KeySym key;
+ unsigned int modifiers;
+ std::string command;
+};
+
+class KeybindsModule {
+public:
+ KeybindsModule(CommandsModule& commandsModule, Config& cfg, Globals& globals, void (*updateMousePos)());
+ ~KeybindsModule() = default;
+ const void bind(const CommandArg* argv);
+ const void handleKeypress(XKeyEvent e);
+ const void clearKeybinds();
+private:
+ std::vector<Keybind> binds;
+ CommandsModule& commandsModule;
+ Config& cfg;
+ Globals& globals;
+ void (*updateMousePos)();
+};