Microsoft DirectX 8.1 (Visual Basic) |
This topic covers the identification of keys for which data is reported by the DirectInputDevice8.GetDeviceState and DirectInputDevice8.GetDeviceData methods. For more information on interpreting the data from GetDeviceData, see Time Stamps and Sequence Numbers.
In one important respect, Microsoft® DirectInput® applications read the keyboard differently from the way Microsoft Windows® does. For DirectInput applications, keyboard data refers not to virtual keys but to the actual physical keys—that is, the scan codes. DIK_ENTER, for example, refers only to the ENTER key on the main keyboard, not to the ENTER key on the numeric keypad.
Additionally, differences among keyboards can affect the way DirectInput applications interpret keyboard data. For example, DirectInput defines a constant for each key on the enhanced keyboard, as well as the additional keys on international keyboards. Because NEC keyboards support different scan codes than the PC-enhanced keyboards, DirectInput translates NEC key-scan codes into PC-enhanced scan codes where possible.
Other keyboard differences to consider are: