From 5f54adae7bc4edaf2c18383efe13ded233255509 Mon Sep 17 00:00:00 2001 From: BossCode45 Date: Fri, 16 Jun 2023 00:05:28 +1200 Subject: feat: Uses a backup config file and respects XDG Uses config files in the order of `$XDG_CONFIG_HOME/YATwm/config`, `$HOME/.config/YATwm/config`, then `/etc/YATwm/config` --- keybinds.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'keybinds.cpp') diff --git a/keybinds.cpp b/keybinds.cpp index 6e4abfd..3a431f0 100644 --- a/keybinds.cpp +++ b/keybinds.cpp @@ -33,7 +33,7 @@ const void KeybindsModule::handleKeypress(XKeyEvent e) const unsigned int masks = ShiftMask | ControlMask | Mod1Mask | Mod4Mask; for(Keybind bind : binds) { - if(bind.modifiers == (e.state & masks) && bind.key == XKeycodeToKeysym(globals.dpy, e.keycode, 0)) + if(bind.modifiers == (e.state & masks) && bind.key == XLookupKeysym(&e, 0)) { commandsModule.runCommand(bind.command); } @@ -89,4 +89,5 @@ const void KeybindsModule::bind(const CommandArg* argv) const void KeybindsModule::clearKeybinds() { XUngrabButton(globals.dpy, AnyKey, AnyModifier, globals.root); + binds = std::vector(); } -- cgit v1.2.3