From 0b539b0b0278f2d7c2b7629e6d28d8463cba2688 Mon Sep 17 00:00:00 2001 From: BossCode45 Date: Mon, 5 Jun 2023 20:35:32 +1200 Subject: Added a very basic config, and fixed some stuff NOTE: for some reason toggling doesn't work anymore --- keybinds.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'keybinds.cpp') diff --git a/keybinds.cpp b/keybinds.cpp index 85e9e4e..6e4abfd 100644 --- a/keybinds.cpp +++ b/keybinds.cpp @@ -10,7 +10,7 @@ using std::string, std::cout, std::endl; -KeybindsModule::KeybindsModule(CommandsModule& commandsModule, Config& cfg, Globals& globals) +KeybindsModule::KeybindsModule(CommandsModule& commandsModule, Config& cfg, Globals& globals, void (*updateMousePos)()) :commandsModule(commandsModule), globals(globals), cfg(cfg) @@ -19,6 +19,7 @@ KeybindsModule::KeybindsModule(CommandsModule& commandsModule, Config& cfg, Glob bindArgs[0] = STR; bindArgs[1] = STR_REST; commandsModule.addCommand("bind", &KeybindsModule::bind, 2, bindArgs, this); + this->updateMousePos = updateMousePos; } const void KeybindsModule::handleKeypress(XKeyEvent e) @@ -27,7 +28,7 @@ const void KeybindsModule::handleKeypress(XKeyEvent e) //cout << "Key Pressed" << endl; //cout << "\tState: " << e.state << endl; //cout << "\tCode: " << XKeysymToString(XKeycodeToKeysym(globals.dpy, e.keycode, 0)) << endl; - //updateMousePos(); + updateMousePos(); const unsigned int masks = ShiftMask | ControlMask | Mod1Mask | Mod4Mask; for(Keybind bind : binds) @@ -80,7 +81,6 @@ const void KeybindsModule::bind(const CommandArg* argv) } } bind.command = argv[1].str; - cout << bind.modifiers << endl; KeyCode c = XKeysymToKeycode(globals.dpy, bind.key); XGrabKey(globals.dpy, c, bind.modifiers, globals.root, False, GrabModeAsync, GrabModeAsync); binds.push_back(bind); -- cgit v1.2.3