From e9cc5756dbb0a2d079a7b5e3438d79945f819df5 Mon Sep 17 00:00:00 2001 From: BossCode45 Date: Sat, 3 Jun 2023 21:30:05 +1200 Subject: feat: Keybind updates Re added the ability to swap super and mod as a config parameter (the ~swapmods~) command). Finally fixed keybinds sometimes not working because of numlock, bitwise & with the modifiers I actually care about. --- main.cpp | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'main.cpp') diff --git a/main.cpp b/main.cpp index 034554c..e74634d 100644 --- a/main.cpp +++ b/main.cpp @@ -51,7 +51,7 @@ Window& root = globals.root; CommandsModule commandsModule; Config cfg(commandsModule); -KeybindsModule keybindsModule(commandsModule, globals); +KeybindsModule keybindsModule(commandsModule, cfg, globals); int sW, sH; int bH; @@ -527,6 +527,9 @@ const void reload(const CommandArg* argv) { detectScreens(); + //Clear keybinds + keybindsModule.clearKeybinds(); + //Load config again vector cfgErr = cfg.reloadFile(); //Error check @@ -964,31 +967,25 @@ int main(int argc, char** argv) //Notifications notify_init("YATwm"); - cout << 0 << endl; //Error check config handleConfigErrs(cfgErr); - cout << 1 << endl; screens = new ScreenInfo[1]; focusedWorkspaces = new int[1]; detectScreens(); - cout << 2 << endl; int screenNum = DefaultScreen(dpy); sW = DisplayWidth(dpy, screenNum); sH = DisplayHeight(dpy, screenNum); - cout << 3 << endl; XSetErrorHandler(OnXError); XSelectInput(dpy, root, SubstructureRedirectMask | SubstructureNotifyMask | KeyPressMask | EnterWindowMask); - cout << 4 << endl; XDefineCursor(dpy, root, XCreateFontCursor(dpy, XC_top_left_arrow)); //EWMH initEWMH(&dpy, &root, cfg.workspaces.size(), cfg.workspaces); setCurrentDesktop(1); - cout << 5 << endl; for(int i = 1; i < cfg.numWS + 1; i++) { vector v; -- cgit v1.2.3