summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2021-11-13 11:09:43 +0100
committerDaniel Friesel <derf@finalrewind.org>2021-11-13 11:09:43 +0100
commit2ca6d3b5e7e1b16a33860dfa1eb81690a1140866 (patch)
tree42fc376d47f1b2ef4f717d5d5209dffe1a512f40 /src
parent8be4f53f8b6b135128fc0b28c5a073770e2f1c90 (diff)
Add bindable button "0" for mouse movement
Useful to make feh quit (or execute actions) on mouse movement Closes #568
Diffstat (limited to 'src')
-rw-r--r--src/events.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/events.c b/src/events.c
index 5bb2ecf..81b7157 100644
--- a/src/events.c
+++ b/src/events.c
@@ -85,6 +85,15 @@ static void feh_set_parse_bb_partial(fehkey *button, char *binding)
button->button = atoi(cur);
button->state = mod;
+
+ if (button->button == 0) {
+ /*
+ * Mod3 is unused on today's keyboards. If Mod3 is unset and button==0,
+ * we are dealing with an uninitialized or unset binding. If Mod3 is set
+ * and button==0, it refers to mouse movement.
+ */
+ button->state |= Mod3Mask;
+ }
}
/*
@@ -680,6 +689,8 @@ static void feh_event_handle_MotionNotify(XEvent * ev)
y = (ev->xbutton.y - winwid->im_y) / winwid->zoom;
thumbnail = feh_thumbnail_get_thumbnail_from_coords(x, y);
feh_thumbnail_select(winwid, thumbnail);
+ } else {
+ feh_event_handle_generic(winwid, ev->xmotion.state | Mod3Mask, NoSymbol, 0);
}
}
return;