From 022735fa72f07facdaa2c7a79f0d3af21a28f266 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Mon, 25 Nov 2013 19:31:13 +0100 Subject: input: discard precise scrolling commands with no value Apparently Cocoa precise scrolling generates a lot of spurious events with a delta that is equal to 0.0. Make sure that they are discarded and not added to the input queue. Even though this only known to happen with Cocoa, I implemented this at core level since it makes sense in general. Fixes: #310 --- mpvcore/input/input.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mpvcore/input/input.c b/mpvcore/input/input.c index b26f2d491d..5a8dee1fd5 100644 --- a/mpvcore/input/input.c +++ b/mpvcore/input/input.c @@ -1639,6 +1639,8 @@ void mp_input_put_key_utf8(struct input_ctx *ictx, int mods, struct bstr t) void mp_input_put_axis(struct input_ctx *ictx, int direction, double value) { + if (value == 0.0) + return; input_lock(ictx); mp_input_feed_key(ictx, direction, value); input_unlock(ictx); -- cgit v1.2.3