0

I've always used AutoHotKey for Windows to implement a scroll method which simulates smartphone scrolling with the mouse right key, using this script. Then I rewrote the scroll wheel to zoom, for the simple reason that I find this new combination waay easier to use.

Now that I'm using dual-boot with Ubuntu, I'm having huge difficulties, because every time that I switch OS I find myself attempting to scroll in the wrong way.

Since AutoHotKey runs neither under Wine or PlayOnLinux and I didn't find any working alternatives, I'd like to know if there was a way to do that on my own.

In javascript I would have made something like this (not tested):

var last;

function scroll() {
    window.scrollBy({
        top: (last - event.clientY) * document.body.clientHeight / 750,
            behaviour: "auto"
        });

        last = event.clientY;
    }

oncontextmenu = function() {
    event.preventDefault;
    last = event.clientY;

    document.body.style.cursor = "grabbing";
    addEventListener('mousemove', scroll);
}

onmouseup = function() {
    document.body.style.cursor = "default";
    removeEventListener('mousemove', scroll);
}

but since Linux is not a website page and I don't know Python, I need some help about how to run something like that in the background since Ubuntu startup.

Thanks in advance for any help.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.