Platform SDK: DirectX |
This topic pertains only to application development in C and C++. See DirectInput Visual Basic Samples.
The MouseNon program demonstrates how to initialize and get immediate data from a DirectInput device.
Source: (SDK root)\Samples\Multimedia\DInput\Src\MouseNon
Executable: (SDK root)\Samples\Multimedia\DInput\Bin
Move the mouse around and observe how the change in coordinates is displayed. Hold down a mouse button and its number is shown. Note that the cursor doesn't have to be in the application window, but the application does have to be in the foreground.
This sample illustrates how an application can use DirectInput to obtain relative mouse data in non-exclusive foreground mode. Approximately 30 times per second the program displays the change in mouse coordinates since the last call to IDirectInputDevice7::GetDeviceState.