JoyDown (button,[port])  

Definition:

Returns TRUE if the specified joystick button is being held down.

Parameter Description:


button = number of joystick button to check
port = number of joystick port to check (optional)

Command Description:

This command (and its counterparts KeyDown and MouseDown) is used to detect if a joystick button is being held down. You must check for each joystick button independantly with its corresponding number (unlike KeyDown which returns WHICH key is being held down). Also see JoyHit.

Example:

; JoyDown Example

; Until user presses ESC, show the mouse button pressed
While Not KeyHit(1)
button$="No"
For t = 1 To 5
If JoyDown(t) Then button$=Str(t)
Print button$ + " joystick button pressed!"
Next
Wend

Index