DirectX SDK

KeybdImm Sample

[Visual Basic]

This topic pertains only to application development in C and C++. See DirectInput Visual Basic Samples.

[C++]

Description

The KeybdImm program obtains and displays keyboard data.

Path

Source: (SDK root)\Samples\Multimedia\DInput\Src\KeybdImm

Executable: (SDK root)\Samples\Multimedia\DInput\Bin

User's Guide

Hold down one or more keys and the index value of each key (see Keyboard Device Constants) is shown.

Programming Notes

This sample illustrates how an application can use DirectInput to obtain immediate keyboard data at the nonexclusive foreground cooperative level. The application repeatedly calls IDirectInputDevice7::GetDeviceState and displays a string containing the values of all the keys that are down.