DirectX SDK

DirectInputDevice.GetDeviceState

The DirectInputDevice.GetDeviceState method retrieves immediate data for a device other than a standard keyboard, mouse, or joystick.

object.GetDeviceState(cb As Long, state As Any)

Parameters

object
Object expression that resolves to a DirectInputDevice object.
cb
Size of the array whose first element is passed as state.
state
First element of an array to receive device state information.

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.SetDataFormat, and acquire the device by using the DirectInputDevice.Acquire method.

See Also

DirectInputDevice.GetDeviceStateJoystick, DirectInputDevice.GetDeviceStateJoystick2, DirectInputDevice.GetDeviceStateKeyboard, DirectInputDevice.GetDeviceStateMouse, DirectInputDevice.SetDataFormat, Buffered and Immediate Data