aboutsummaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'main.c')
-rw-r--r--main.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/main.c b/main.c
index 5bcc90e..713e880 100644
--- a/main.c
+++ b/main.c
@@ -605,15 +605,15 @@ end:
redraw();
}
-static bool process_bindings(const keymap_t *keys, unsigned int len,
- KeySym ksym_or_button, unsigned int state)
+static bool process_bindings(const keymap_t *keys, unsigned int len, KeySym ksym_or_button,
+ unsigned int state, unsigned int implicit_mod)
{
unsigned int i;
bool dirty = false;
for (i = 0; i < len; i++) {
if (keys[i].ksym_or_button == ksym_or_button &&
- MODMASK(keys[i].mask) == MODMASK(state) &&
+ MODMASK(keys[i].mask | implicit_mod) == MODMASK(state) &&
keys[i].cmd.func &&
(keys[i].cmd.mode == MODE_ALL || keys[i].cmd.mode == mode))
{
@@ -652,7 +652,7 @@ static void on_keypress(XKeyEvent *kev)
prefix = prefix * 10 + (int) (key - '0');
return;
} else {
- dirty = process_bindings(keys, ARRLEN(keys), ksym, kev->state & ~sh);
+ dirty = process_bindings(keys, ARRLEN(keys), ksym, kev->state, sh);
}
if (dirty)
redraw();
@@ -668,7 +668,7 @@ static void on_buttonpress(XButtonEvent *bev)
if (mode == MODE_IMAGE) {
set_timeout(reset_cursor, TO_CURSOR_HIDE, true);
reset_cursor();
- dirty = process_bindings(buttons, ARRLEN(buttons), bev->button, bev->state);
+ dirty = process_bindings(buttons, ARRLEN(buttons), bev->button, bev->state, 0);
if (dirty)
redraw();
} else {