4

By that I mean is there a command I could type into the terminal then click on a window behind, and It is scrolled up / down, and then turn this into a custom shortcut?

xdotool key Next or xdotool key Page_Down is not what I want, I'm looking for one that is metaphorically 'deeper' in the way Linux / general OSs works.

I know how to use xdotool, but I don't want to use it. I want to know the command that is executed when that button is pressed, XDO words as an emulator essentially.

Braiam
  • 69,112
Tim
  • 33,500

2 Answers2

5

I'm looking for one that is metaphorically 'deeper' in the way Linux / general OSs works

Metaphor be damned, this is how it actually works:

  • You mash the keyboard
  • An evdev driver/keymap/etc converts that into an X11 event
  • The display server sends the event to the application (and optionally bubbles that up the stack)
  • The application (or its framework) determines what to do with the input

There is no "paging" metaphor built into X; it's just a behaviour common to many applications and their frameworks.

So in terms of emulating an event that looks like somebody hit the Page Down key, your best bet is actually generating that X11 event and sending it to the window.

Your only other option is to add an alternative interface for your running application that it intercepts and internally makes the change to the window. That's very possible but it's also a metric buttload of work.

Oli
  • 299,380
2

The sleep command is a good way to add a delay (so in my example its 60s) then double ampersand to run an additional command when the sleep has finished.

sleep 60 && xdotool key Page_Up
sleep 60 && xdotool key Page_Down

XDO is for simulating keypresses in X11, not sure how deeper you can go from a terminal without writing your own app to manipulate X11 apis directly.

NGRhodes
  • 9,680