summaryrefslogtreecommitdiff
path: root/keybinds.cpp
diff options
context:
space:
mode:
authorBossCode45 <human.cyborg42@gmail.com>2023-06-16 00:05:28 +1200
committerBossCode45 <human.cyborg42@gmail.com>2023-06-16 00:05:28 +1200
commit5f54adae7bc4edaf2c18383efe13ded233255509 (patch)
treeda3736531e9be6ea57057f7178bfb2baf5a061f9 /keybinds.cpp
parent0b539b0b0278f2d7c2b7629e6d28d8463cba2688 (diff)
downloadYATwm-5f54adae7bc4edaf2c18383efe13ded233255509.tar.gz
YATwm-5f54adae7bc4edaf2c18383efe13ded233255509.zip
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`
Diffstat (limited to 'keybinds.cpp')
-rw-r--r--keybinds.cpp3
1 files changed, 2 insertions, 1 deletions
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<Keybind>();
}