summaryrefslogtreecommitdiff
path: root/keybinds.h
diff options
context:
space:
mode:
authorBossCode45 <human.cyborg42@gmail.com>2024-10-01 14:54:37 +1300
committerBossCode45 <human.cyborg42@gmail.com>2024-10-01 14:54:37 +1300
commit915532bf8fbda9ba2a36e04fcd6acc67c6c68fa5 (patch)
tree0d7a7569ab5fc30c90d5df91a54d312c764cf328 /keybinds.h
parentf998705c5a0e50021875a811537962083b73ed26 (diff)
downloadYATwm-915532bf8fbda9ba2a36e04fcd6acc67c6c68fa5.tar.gz
YATwm-915532bf8fbda9ba2a36e04fcd6acc67c6c68fa5.zip
Restructure
Diffstat (limited to 'keybinds.h')
-rw-r--r--keybinds.h59
1 files changed, 0 insertions, 59 deletions
diff --git a/keybinds.h b/keybinds.h
deleted file mode 100644
index a742240..0000000
--- a/keybinds.h
+++ /dev/null
@@ -1,59 +0,0 @@
-#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 {
- KeyCode key;
- unsigned int modifiers;
- bool operator<(const Keybind &o) const;
- bool operator==(const Keybind &o) const;
-};
-
-struct KeyFunction
-{
- std::string command;
- int mapID;
-};
-
-#define getKeymap(X) \
- keyMaps.find(X)->second
-
-
-class KeybindsModule
-{
-public:
- KeybindsModule(CommandsModule& commandsModule, Config& cfg, Globals& globals, void (*updateMousePos)());
- ~KeybindsModule() = default;
- const void bind(const CommandArg* argv);
- const void quitKey(const CommandArg* argv);
- const void bindMode(const CommandArg* argv);
- const void handleKeypress(XKeyEvent e);
- const void clearKeybinds();
-private:
- Keybind getKeybind(std::string bindString);
- void changeMap(int newMapID);
- std::map<int, std::map<Keybind, KeyFunction>> keyMaps;
- const Keybind emacsBindMode(std::string bindString);
- const Keybind normalBindMode(std::string bindString);
- std::map<std::string, const Keybind(KeybindsModule::*)(std::string bindString)> bindModes;
- const Keybind(KeybindsModule::* bindFunc)(std::string bindString);
- // Modifier keys to ignore when canceling a keymap
- KeyCode ignoredKeys[8] = {50, 37, 133, 64, 62, 105, 134, 108};
- int currentMapID = 0;
- int nextKeymapID = 1;
- Keybind exitBind = {42, 0x40};
- CommandsModule& commandsModule;
- Config& cfg;
- Globals& globals;
- void (*updateMousePos)();
-};