Share via


Joystick Data

To set up the joystick device for data retrieval, first call the IDirectInputDevice8::SetDataFormat method with the c_dfDIJoystick or the c_dfDIJoystick2 global variable as the parameter value. (See Device Data Formats.).

Because some device drivers do not notify Microsoft DirectInput of changes in state until explicitly asked to do so, you should always call the IDirectInputDevice8::Poll method before attempting to retrieve data from the joystick. For more information, see Polling and Event Notification.

The following sections cover retrieval and interpretation of data from a joystick or other similar input device such as a game pad or steering wheel: