DirectX SDK |
The DIKEYBOARDSTATE type contains information about the state of keyboard keys. This type is used with the DirectInputDevice.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 DirectInputDevice object. Call diDevice.GetDeviceStateKeyboard(keyState) If (keyState.key(DIK_ESCAPE) And &H80) Then ' Key is down End If