diff options
author | Robin Watts <robin.watts@artifex.com> | 2013-08-14 10:55:32 +0100 |
---|---|---|
committer | Robin Watts <robin.watts@artifex.com> | 2013-08-21 19:53:59 +0100 |
commit | bb0876c8422b31ab912af36ec010416ecea09712 (patch) | |
tree | 49989067cb3fd70aa71cb1b956a1f8f6d49aa4cd /platform/x11 | |
parent | c8c5e2205b80f79590af55e91776085b5acd0490 (diff) | |
download | mupdf-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.
Diffstat (limited to 'platform/x11')
-rw-r--r-- | platform/x11/pdfapp.c | 9 |
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) |