Question

How do I get buttons in a HTML webpage to control a series of commad-line programs, by executing the program when the button is held down, and stopping when the button is released - if desperate the mouse button being pressed could just start the command, and the button being released could send to kill it - but a quick response time would be nice.

The commands I want to execute are either some bash scripts or some python scripts - which it does execute not matter to much.

I have mapped the buttons to an image, and used the Javascript events onmousedown= and onmouseup= to control the commands - but how do I get these to execute the commands, with a script creating a web page? At a guess I will need the javascript to run some PHP functions, but I am an utter noob when it comes to php...

This will need to work on a Fedora/Ubuntu linux machine, preferably in Firefox, and later be adapted for an Android tablet, perhaps in a QT app if I can by head around qt-creator

Was it helpful?

Solution

Chrome offers native messaging, which may do what you want. you will need a helper program. Right now I'm reading http://developer.chrome.com/extensions/messaging.html#native-messaging

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top