mokuro icon indicating copy to clipboard operation
mokuro copied to clipboard

Changing page with arrow keys.

Open aidan-kelly opened this issue 1 year ago • 5 comments

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?

aidan-kelly avatar Jul 20 '22 21:07 aidan-kelly

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

epistularum avatar Jul 24 '22 15:07 epistularum

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.

nienkeboomsma avatar Mar 19 '23 11:03 nienkeboomsma

@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!

jonstrutz11 avatar May 04 '23 03:05 jonstrutz11

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();
});

evkaw avatar Jul 03 '23 03:07 evkaw

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;
    }
});

phongtrantam avatar Aug 23 '23 16:08 phongtrantam