Microsoft DirectX 8.1 (Visual Basic) |
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
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