6

I'm writing a bash script to control a browser remotely. So far I have vertical scrolling implemented using

xdotool click 4 //up
xdotool click 5 //down

How can I implement horizontal scrolling using xdotool? I saw numbers 6 and 7 mentioned on some site, but that did not work.

Alex Stone
  • 46,408
  • 55
  • 231
  • 407

2 Answers2

3

Instead of a click, you can send the Left or Right arrow keys:

xdotool key Right
xdotool key Left

  • Unfortunately, this won't do everytime. For example, on spreadsheets, the selector will just move left/right to the adjacent cell rather than scrolling the whole work space sideways. – Jacobski Oct 25 '21 at 00:09
2

Just use these:

xdotool click 6 # left
xdotool click 7 # right
M310
  • 397
  • 2
  • 13