Tao.Platform.Windows SDK Documentation

Winmm.joyGetPos Method 

The joyGetPos function queries a joystick for its position and button status.

[Visual Basic]
Public Shared Function joyGetPos( _
   ByVal uJoyID As Integer, _
   ByRef pji As JOYINFO _
) As Integer
[C#]
public static int joyGetPos(
   int uJoyID,
   ref JOYINFO pji
);

Parameters

uJoyID
Identifier of the joystick to be queried. Valid values for uJoyID range from zero (JOYSTICKID1) to 15, except for Windows NT 4.0. For Windows NT 4.0, valid values are limited to JOYSTICKID1 and JOYSTICKID2.
pji
Pointer to a Winmm.JOYINFO structure that contains the position and button status of the joystick.

Return Value

Returns JOYERR_NOERROR if successful or one of the following error values.

MMSYSERR_NODRIVER - The joystick driver is not present. MMSYSERR_INVALPARAM - An invalid parameter was passed. JOYERR_UNPLUGGED - The specified joystick is not connected to the system.

Remarks

For devices that have four to six axes of movement, a point-of-view control, or more than four buttons, use the joyGetPosEx function.

See Also

Winmm Class | Tao.Platform.Windows Namespace