Hardware Scroll Buttons

Raspberry Pi related support

Hardware Scroll Buttons

Postby rlsten » 10 Aug 2017, 00:31

Would it be possible to program hardware buttons to emulate the scroll up and scroll down software buttons on the library page. The code for the software buttons is located in /srv/assets/js/runeui.js and runeui.min.js; my question is how does one call that code in a python script, such as was used for a hardware play/pause button here: http://www.runeaudio.com/forum/hardware-play-pause-button-t3665-10.html?hilit=buttons#p15487. Specifically, what would I substitute for this line in the hardware play/pause script:

Code: Select all
subprocess.call("mpc toggle", shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)


Thanks!
rlsten
 
Posts: 78
Joined: 25 May 2015, 18:06

Re: Hardware Scroll Buttons

Postby hondagx35 » 10 Aug 2017, 10:23

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
User avatar
hondagx35
 
Posts: 2693
Joined: 11 Sep 2014, 22:06
Location: Germany

Re: Hardware Scroll Buttons

Postby rlsten » 10 Aug 2017, 16:28

Thanks very much, Frank. I will try to emulate the up and down keys.

Rod
rlsten
 
Posts: 78
Joined: 25 May 2015, 18:06

support RuneAudio Donate with PayPal


Return to Raspberry Pi

Who is online

Users browsing this forum: No registered users and 1 guest