summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin Watts <robin.watts@artifex.com>2013-08-14 10:55:32 +0100
committerRobin Watts <robin.watts@artifex.com>2013-08-21 19:53:59 +0100
commitbb0876c8422b31ab912af36ec010416ecea09712 (patch)
tree49989067cb3fd70aa71cb1b956a1f8f6d49aa4cd
parentc8c5e2205b80f79590af55e91776085b5acd0490 (diff)
downloadmupdf-bb0876c8422b31ab912af36ec010416ecea09712.tar.xz
Enable horizontal mouse scrolling in X11.
Based on a patch from Sebastian Neuser - many thanks. Use mouse buttons 6 and 7 to do the same as 4 and 5, but with Y rather than X being the default.
-rw-r--r--platform/x11/pdfapp.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/platform/x11/pdfapp.c b/platform/x11/pdfapp.c
index fc88eeae..707c0a2a 100644
--- a/platform/x11/pdfapp.c
+++ b/platform/x11/pdfapp.c
@@ -1515,6 +1515,15 @@ void pdfapp_onmouse(pdfapp_t *app, int x, int y, int btn, int modifiers, int sta
pdfapp_panview(app, app->panx + xstep, app->pany + ystep);
}
}
+ if (btn == 6 || btn == 7) /* scroll wheel (horizontal) */
+ {
+ /* scroll left/right or up/down if shift is pressed */
+ int dir = btn == 6 ? 1 : -1;
+ int isx = (modifiers & (1<<0));
+ int xstep = !isx ? 20 * dir : 0;
+ int ystep = isx ? 20 * dir : 0;
+ pdfapp_panview(app, app->panx + xstep, app->pany + ystep);
+ }
}
else if (state == -1)