Hi rlsten,
Would it be possible to program hardware buttons to emulate the scroll up and scroll down software buttons on the library page.
This is not possible the easy way.
The javascript code runs on the client side (browser) and not on the server.
This is also true when using a local browser on an attached display.
Play, pause, next and volume control are handled by mpd (music player daemon) that runs on the server.
Mpd reports these changes to the client via WebSocket connections which are processed within the javascript code.
If it is meant for the local browser option, I would try to emulate the up and down arrow keys.
https://github.com/tuomasjjrasanen/python-uinput
Frank