Declare Function joyGetPos Lib "winmm.dll" (ByVal uJoyID As Long, pji As JOYINFO) As Long
joyGetPos reads the current position and status of a joystick. This information is put into the variable passed as pji. The function returns 0 if the joystick is connected and working, or a non-zero value if it is not.
Example:
' Read the joystick's x and y coordinates
Dim pos As JOYINFO
x = joyGetPos(0, pos)
Debug.Print "Coordinates:" pos.wXpos; pos.wYpos
Category: Joysticks
Back to the index.