summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDevin J. Pohly <djpohly@gmail.com>2020-04-11 19:46:51 -0500
committerDevin J. Pohly <djpohly@gmail.com>2020-04-11 19:46:51 -0500
commit9240a40569d14dcecbd44b1302a755bcc6a19bdc (patch)
tree6d6319c5258ae5e990118e4813e547a3c80d444f
parent21f42a86d7be1046a7ddc99487ab98d41fef2c8f (diff)
add CLEANMASK like dwm
-rw-r--r--dwl.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/dwl.c b/dwl.c
index 24eeca3..6ef5862 100644
--- a/dwl.c
+++ b/dwl.c
@@ -26,6 +26,7 @@
#include <wlr/util/log.h>
#include <xkbcommon/xkbcommon.h>
+#define CLEANMASK(mask) (mask & ~WLR_MODIFIER_CAPS)
#define LENGTH(X) (sizeof X / sizeof X[0])
/* For brevity's sake, struct members are annotated where they are used. */
@@ -197,7 +198,9 @@ static bool handle_keybinding(struct dwl_server *server, uint32_t mods, xkb_keys
*/
bool handled = false;
for (int i = 0; i < LENGTH(keys); i++) {
- if (sym == keys[i].keysym && mods == keys[i].mod && keys[i].func) {
+ if (sym == keys[i].keysym &&
+ CLEANMASK(mods) == CLEANMASK(keys[i].mod) &&
+ keys[i].func) {
keys[i].func(server, &keys[i].arg);
handled = true;
}