Mouse Data

To set up the mouse device for data retrieval, first call the IDirectInputDevice::SetDataFormat method with the c_dfDIMouse global variable as the parameter.

For maximum performance in a full-screen application, set the cooperative level to DISCL_EXCLUSIVE | DISCL_FOREGROUND. Note that the exclusive setting will cause the Windows cursor to disappear. Remember too that the DISCL_FOREGROUND setting will cause the application to lose access to the mouse when you switch to a debugging window. Changing to DISCL_BACKGROUND will allow you to debug the application more easily, at a cost in performance.

The following sections give more information about getting and interpreting immediate and buffered mouse data.

See also: