I once found out how to read/write the parallel port in ARexx and wrote a
simple level meter for 8bit sound samplers, but as my 2 Amigas are linked
through the parallel port it means I can't use it for inputting with so I
looked at reading the 5 inputs from the joystick port as I don't use that,
and after a little help (thanks Neko for the docs) I figured out how to
read the joystick port in arexx.
It's dead dead dead dead simple, just add these lines into your ARexx
script whenever you need to read the joystick port:
/* reading a joystick plugged into the mouse port */
/* reading a joystick plugged into the joystick port */
j0f is joystick port 0 fire button (the left mouse basically)
j1f is joystick port 1 fire button (the normal joystick fire)
figure the rest out for yourself :)
The variables return 0 or 1 for the state of the button.
With this kind of input you can put manual switches into an old joystick
lead which will enable you to "physically" configure programs, you could
have an ARexx script on bootup sensing a switch on the joystick port
which then would execute separate scripts according to the switch position.
Myself, I'll at first be using it to set wether I'm in front of the computer
or away/asleep as when my computer is online it has scripts to keep it on IRC
& ICQ, the switch would control wether I'm '/away' on IRC and 'Not Available'