- Home
·
- Games
·
- This shows how to use DirectInput in your application. Please note that you will need the DirectX 7
This shows how to use DirectInput in your application. Please note that you will need the DirectX 7
This shows how to use DirectInput in your application. Please note that you will need the DirectX 7 library for VB. Download it at
API Declarations
Public DI As DirectInput
Public DIV As DirectInputDevice
Public DID As DirectInputEnumDevices
Public DI_GUID As String
Dim DII As DirectInputDeviceInstance
Public KeyB As DIKEYBOARDSTATE
Rate This shows how to use DirectInput in your application. Please note that you will need the DirectX 7
(1(1 Vote))
Dim DI_GUID As String
Set DI = DX.DirectInputCreate
Set DID = DI.GetDIEnumDevices(DIDEVTYPE_KEYBOARD, DIEDFL_ATTACHEDONLY)
Set DII = DID.GetItem(1)
DI_GUID = DII.GetGuidInstance
Set DIV = DI.CreateDevice(DI_GUID)
DIV.SetCommonDataFormat DIFORMAT_KEYBOARD
DIV.SetCooperativeLevel frmMain.hWnd, DISCL_BACKGROUND Or DISCL_NONEXCLUSIVE
DIV.Acquire
End Sub
Public Sub UpdateInput()
DIV.GetDeviceStateKeyboard KeyB
End Sub
This shows how to use DirectInput in your application. Please note that you will need the DirectX 7 Comments
No comments yet — be the first to post one!
Post a Comment