diff options
author | Robin Watts <robin.watts@artifex.com> | 2015-03-30 17:05:19 +0100 |
---|---|---|
committer | Robin Watts <robin.watts@artifex.com> | 2015-03-30 17:35:43 +0100 |
commit | 8d0ae07482401c8eab116c3dd6a78fde469e03ad (patch) | |
tree | c0300d5a2414f6a3bacf1535b3256b512ce26ca5 /platform/x11/pdfapp.c | |
parent | fd5a4f5128e76b1b9cf35f70b1341e67f640e9be (diff) | |
download | mupdf-8d0ae07482401c8eab116c3dd6a78fde469e03ad.tar.xz |
Bug 695804: Add support for 'Shift-Space' in the viewer.
Update pdfapp_onkey to take modifiers. If shift is held down when
space is sent, then back up a page.
This involves updating the windows app to actually send modifiers.
Previously they were always sent as zero to the onmouse routine.
Diffstat (limited to 'platform/x11/pdfapp.c')
-rw-r--r-- | platform/x11/pdfapp.c | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/platform/x11/pdfapp.c b/platform/x11/pdfapp.c index a54a357b..a4c3488d 100644 --- a/platform/x11/pdfapp.c +++ b/platform/x11/pdfapp.c @@ -1016,7 +1016,7 @@ void pdfapp_autozoom(pdfapp_t *app) pdfapp_autozoom_vertical(app); } -void pdfapp_onkey(pdfapp_t *app, int c) +void pdfapp_onkey(pdfapp_t *app, int c, int modifiers) { int oldpage = app->pageno; enum panning panto = PAN_TO_TOP; @@ -1048,7 +1048,7 @@ void pdfapp_onkey(pdfapp_t *app, int c) pdfapp_showpage(app, 1, 1, 0, 0, 1); } - pdfapp_onkey(app, 'n'); + pdfapp_onkey(app, 'n', 0); } else winrepaint(app); @@ -1293,10 +1293,20 @@ void pdfapp_onkey(pdfapp_t *app, int c) case ' ': panto = DONT_PAN; - if (app->numberlen > 0) - app->pageno += atoi(app->number); + if (modifiers & 1) + { + if (app->numberlen > 0) + app->pageno -= atoi(app->number); + else + app->pageno--; + } else - app->pageno++; + { + if (app->numberlen > 0) + app->pageno += atoi(app->number); + else + app->pageno++; + } break; case '<': |