Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changing page with arrow keys. #16

Open
aidan-kelly opened this issue Jul 20, 2022 · 5 comments
Open

Changing page with arrow keys. #16

aidan-kelly opened this issue Jul 20, 2022 · 5 comments
Labels
enhancement New feature or request

Comments

@aidan-kelly
Copy link

Hey there, love the application. I will be using it daily from now on.
One thing I noticed while using it today was that using the arrow keys moves the orientation of the page and doesn't change to a new page as I would expect.
Would this kind of functionality be welcomed?

@epistularum
Copy link

The about/help menu within the image viewer displays a list of shortcuts for navigation. What you're looking for is the pageup/pagedown keys or the home and end keys.
image

@nienkeboomsma
Copy link

Not all keyboards have those keys, though.

I find the current navigation pretty counterintuitive. When I use left/right arrow keys, I expect to move to the next/previous page, not to move left/right in the current page, and when I scroll, I expect to move left/right/up/down in the page, not to zoom in/out.

@jonstrutz11
Copy link

@nienkeboomsma just FYI I found that even though it isn't mentioned above, you can also move to the next page with space if that is helpful!

@kha-white kha-white added the enhancement New feature or request label May 7, 2023
@evkaw
Copy link

evkaw commented Jul 3, 2023

create a userscript using tampermonkey or sorts and paste this in:

document.addEventListener('keyup', function (e) {
    if (e.key === 'ArrowLeft' ) document.getElementById('leftAScreen').click();
    else if (e.key === 'ArrowRight') document.getElementById('rightAScreen').click();
});

@phongtrantam
Copy link

you can workaround with a little js, open your html file or js file, find the code below and edit it

    pz = panzoom(pc, {
        bounds: true,
        boundsPadding: 0.05,
        maxZoom: 10,
        minZoom: 0.1,
        zoomDoubleClickSpeed: 1,
        enableTextSelection: true,

        // add this option
        filterKey: function( e, dx, dy, dz ) {
            // don't let panzoom handle this event:
            return true;
        },

document.addEventListener("keydown", function onEvent(e) {
    switch (e.key) {
        // change to any key you want
        case "ArrowRight":
            prevPage();
            break;

        case "ArrowLeft":
            nextPage();
            break;

        case "9":
            firstPage();
            break;

        case "3":
            lastPage();
            break;

        case " ":
            nextPage();
            break;

        case ".":
            zoomDefault();
            break;
    }
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

7 participants