Command-Line – What Command Does PgDn / PgUp Execute in Xorg?

command linexorg

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.

Best Answer

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.

Related Question