Platform SDK: DirectX

Keyboard Sample

[C++]

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

[Visual Basic]

Description

The Keyboard sample shows how to create a keyboard device and retrieve immediate data from it.

Path

Source: (SDK root)\Samples\Multimedia\VBSamples\Dinput\Src\Keyboard

Executable: (SDK root)\Samples\Multimedia\VBSamples\Dinput\Bin\Keyboard.exe

User's Guide

As you hold down one or more keys, the names of the keys (from CONST_DIKEYFLAGS) are shown in the list box.

Programming Notes

The background cooperative level is used, so keys are read even when the application does not have the input focus.