8

Other than using xdotool is there a way to scroll down by a set amount using a command. In other words, what is the scrolling command?

I'm not looking for a keyboard shortcut, I want a command for scrolling by say 10px in the currently focussed window. I also don't want xdotool because I need the "deeper command", what is "executed" when the wheel is rolled.

Tim
  • 33,500

4 Answers4

9

Not exactly what you asked for, because the OP asked for "10px" scrolling, but since it also asked for "what is executed when the wheel is rolled". In Linux, when the wheel is rolled, it's up to the application to interpret it, but you can still simulate wheel rolling.

Wheel rolling up and down are typically mapped as mouse button 4 and 5 respectively. The following command will simulate scrolling up

xdotool click 4

and the following command will simulate scrolling down

xdotool click 5

Use custom shortcuts or scripts to bind your input events to this command to simulate a wheel roll.

mchid
  • 44,904
  • 8
  • 102
  • 162
mogsie
  • 215
4

xdotool lets you send keyboard keys too so all the standard stuff like:

xdotool key Page_Down
xdotool key Down Down Down  # presses down three times with a 12ms delay
xdotool key --delay 2 Down Down Down  # as above but 2ms

With respect to the "deeper command", there's no one such thing. A window is sent an event (like a mousewheel) and it (the program or —more commonly— its toolkit) decides how to interpret that.

The scrolling isn't directly controllable (unless you're using an application or framework that provides an interface for doing just that). I've explained this a little bit more in your last question.

Oli
  • 299,380
0
  • Install xdotool:

    sudo apt-get install xdotool
    
  • Get mouse pointer location:

    xdotool getmouselocation
    
  • Scroll using click 4 & 5 (change XXX and YYY from above command):

    xdotool mousemove XXX YYY click 4
    

    xdotool mousemove XXX YYY click 5

Source: https://askubuntu.com/a/329009/536195

ThunderBird
  • 1,963
  • 13
  • 22
  • 31
-1

Scroll backwards:

Shift + Page Up

Scroll Forwards:

Shift + Page Down
Korkel
  • 1,168