Microsoft DirectX 8.1 (Visual Basic)

DIKEYBOARDSTATE

Describes the state of keyboard keys. This type is used with the DirectInputDevice8.GetDeviceStateKeyboard method.

Type DIKEYBOARDSTATE
    key(0 To 255) As Byte
End Type

Members

key
Array of key states. The array can be indexed by using members of the CONST_DIKEYFLAGS enumeration. For each key, the high bit is set if the key is down, and clear if the key is up or does not exist.

Remarks

The following example checks to see if the ESC key is being pressed:

Dim keyState as DIKEYBOARDSTATE
' diDevice is a valid DirectInputDevice8 object.
 
Call diDevice.GetDeviceStateKeyboard(keyState)
If (keyState.key(DIK_ESCAPE) And &H80) Then
    ' Key is down
End If