Platform SDK: DirectX

DirectInputDevice.GetDeviceStateJoystick2

The DirectInputDevice.GetDeviceStateJoystick2 method retrieves instantaneous data from a joystick device with extended capabilities.

object.GetDeviceStateJoystick2(state As DIJOYSTATE2)

Parameters

object
Object expression that resolves to a DirectInputDevice object.
state
A DIJOYSTATE2 type that receives the current state of the device. The format of the data is established by a prior call to the DirectInputDevice.SetDataFormat method.

Error Codes

If the method fails, an error is raised and Err.Number may be one of the following error codes:

DIERR_INPUTLOST
DIERR_INVALIDPARAM
DIERR_NOTACQUIRED
E_PENDING

Remarks

Before device data can be obtained, you must set the cooperative level by using the DirectInputDevice.SetCooperativeLevel method, then set the data format by using DirectInputDevice.SetCommonDataFormat, and acquire the device by using the DirectInputDevice.Acquire method.

See Also

DirectInputDevice.Poll, Polling and Events