Platform SDK: DirectX |
This topic pertains only to application development in Visual Basic. See DirectInput C/C++ Tutorials.
The first step in setting up the DirectInput system is to create a single DirectInput object as overall manager. This is done with a call to the DirectX7.DirectInputCreate method, typically in the Load event handler for the main form or in Sub Main:
Dim dx As New DirectX7 Dim di As DirectInput Set di = dx.DirectInputCreate()
The keyboard is then created as a standard device by passing the keyboard GUID alias to DirectInput.CreateDevice:
Dim didev As DirectInputDevice Set didev = di.CreateDevice("GUID_SysKeyboard")