dir = JoyDir(port[, idx])
port
. The optional argument idx
can be used
to specify the index of the joystick to use in case there are multiple
joysticks on a controller. Joystick indices start at 0.
One of the following states will be returned:
#JOYUP
#JOYUPRIGHT
#JOYRIGHT
#JOYDOWNRIGHT
#JOYDOWN
#JOYDOWNLEFT
#JOYLEFT
#JOYUPLEFT
#JOYNODIR
port
can range from 0 to the number of joysticks currently plugged in
minus 1. You can find out the number of joysticks currently available
using the CountJoysticks() function. Please note
that under AmigaOS, port 0 addresses the standard joystick port although
this is port 1 on classic Amiga hardware. Hollywood switches these ports
for cross-platform consistency where port 0 shall always refer to the
default joystick.
While state <> #JOYRIGHT state = JoyDir(0) VWait WendThe above code waits until the user moves the Joystick in port 0 to right.