VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



This shows how to use DirectInput in your application. Please note that you will need the DirectX 7

by Bart 'mainframe' vd Sande [gangstersoft] ()
Category: Games
Compatability: Visual Basic 5.0
Difficulty: Unknown Difficulty
Originally Published: Sun 4th March 2001
Date Added: Mon 8th February 2021
Rating: (1 Votes)

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



    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


Download this snippet    Add to My Saved Code

This shows how to use DirectInput in your application. Please note that you will need the DirectX 7 Comments

No comments have been posted about This shows how to use DirectInput in your application. Please note that you will need the DirectX 7. Why not be the first to post a comment about This shows how to use DirectInput in your application. Please note that you will need the DirectX 7.

Post your comment

Subject:
Message:
0/1000 characters