DirectX SDK |
This topic pertains only to application development in C and C++. See DirectInput Visual Basic Samples.
The KeybdExc sample shows how to use the keyboard at the exclusive cooperative level.
Source: (SDK root)\Samples\Multimedia\DInput\Src\KeybdExc
Executable: (SDK root)\Samples\Multimedia\DInput\Bin\KeybdExc.exe
Hold down one or more keys and the index value of each key (see Keyboard Device Constants) is shown. Note that the Windows key does not activate the system Start menu, as it does in the KeybdImm Sample.
This sample illustrates how an application can use DirectInput to obtain immediate keyboard data at the exclusive foreground cooperative level. The application repeatedly calls IDirectInputDevice7::GetDeviceState and displays a string containing the values of all the keys that are down.