Platform SDK: DirectX |
DirectInputDevice.GetDeviceStateKeyboard メソッドは、キーボード デバイスから直接データを取得する。
object.GetDeviceStateKeyboard(state As DIKEYBOARDSTATE)
失敗すればエラーが発生し、Err.Number に次のいずれかのエラー コードが設定される。
DIERR_INPUTLOST |
DIERR_INVALIDPARAM |
DIERR_NOTACQUIRED |
E_PENDING |
デバイス データを取得する前に、DirectInputDevice.SetCooperativeLevel メソッドで協調レベルを設定し、DirectInputDevice.SetCommonDataFormat メソッドでデータ形式を設定し、DirectInputDevice.Acquire メソッドでデバイスを取得しなければならない。