1 | ' dinput.sbp
|
---|
2 |
|
---|
3 |
|
---|
4 | #ifndef _INC_DINPUT
|
---|
5 | #define _INC_DINPUT
|
---|
6 |
|
---|
7 |
|
---|
8 | '----------------
|
---|
9 | ' Version
|
---|
10 | '----------------
|
---|
11 |
|
---|
12 | Const DIRECTINPUT_VERSION = &H0800
|
---|
13 |
|
---|
14 |
|
---|
15 | '----------------
|
---|
16 | ' Interfaces
|
---|
17 | '----------------
|
---|
18 |
|
---|
19 | Dim IID_IDirectInput8 = [&HBF798030,&H483A,&H4DA2,[&HAA,&H99,&H5D,&H64,&HED,&H36,&H97,&H00]] As GUID
|
---|
20 | Dim IID_IDirectInputDevice8 = [&H54D41080,&HDC15,&H4833,[&HA4,&H1B,&H74,&H8F,&H73,&HA3,&H81,&H79]] As GUID
|
---|
21 | Dim IID_IDirectInputEffect = [&HE7E1F7C0,&H88D2,&H11D0,[&H9A,&HD0,&H00,&HA0,&HC9,&HA0,&H6E,&H35]] As GUID
|
---|
22 |
|
---|
23 |
|
---|
24 | '-------------------------
|
---|
25 | ' Predefined object types
|
---|
26 | '-------------------------
|
---|
27 |
|
---|
28 | Dim GUID_XAxis = [&HA36D02E0,&HC9F3,&H11CF,[&HBF,&HC7,&H44,&H45,&H53,&H54,&H00,&H00]] As GUID
|
---|
29 | Dim GUID_YAxis = [&HA36D02E1,&HC9F3,&H11CF,[&HBF,&HC7,&H44,&H45,&H53,&H54,&H00,&H00]] As GUID
|
---|
30 | Dim GUID_ZAxis = [&HA36D02E2,&HC9F3,&H11CF,[&HBF,&HC7,&H44,&H45,&H53,&H54,&H00,&H00]] As GUID
|
---|
31 | Dim GUID_RxAxis = [&HA36D02F4,&HC9F3,&H11CF,[&HBF,&HC7,&H44,&H45,&H53,&H54,&H00,&H00]] As GUID
|
---|
32 | Dim GUID_RyAxis = [&HA36D02F5,&HC9F3,&H11CF,[&HBF,&HC7,&H44,&H45,&H53,&H54,&H00,&H00]] As GUID
|
---|
33 | Dim GUID_RzAxis = [&HA36D02E3,&HC9F3,&H11CF,[&HBF,&HC7,&H44,&H45,&H53,&H54,&H00,&H00]] As GUID
|
---|
34 | Dim GUID_Slider = [&HA36D02E4,&HC9F3,&H11CF,[&HBF,&HC7,&H44,&H45,&H53,&H54,&H00,&H00]] As GUID
|
---|
35 | Dim GUID_Button = [&HA36D02F0,&HC9F3,&H11CF,[&HBF,&HC7,&H44,&H45,&H53,&H54,&H00,&H00]] As GUID
|
---|
36 | Dim GUID_Key = [&H55728220,&HD33C,&H11CF,[&HBF,&HC7,&H44,&H45,&H53,&H54,&H00,&H00]] As GUID
|
---|
37 | Dim GUID_POV = [&HA36D02F2,&HC9F3,&H11CF,[&HBF,&HC7,&H44,&H45,&H53,&H54,&H00,&H00]] As GUID
|
---|
38 | Dim GUID_Unknown = [&HA36D02F3,&HC9F3,&H11CF,[&HBF,&HC7,&H44,&H45,&H53,&H54,&H00,&H00]] As GUID
|
---|
39 |
|
---|
40 |
|
---|
41 | '--------------------------
|
---|
42 | ' Predefined product GUIDs
|
---|
43 | '--------------------------
|
---|
44 |
|
---|
45 | Dim GUID_SysMouse = [&H6F1D2B60,&HD5A0,&H11CF,[&HBF,&HC7,&H44,&H45,&H53,&H54,&H00,&H00]] As GUID
|
---|
46 | Dim GUID_SysKeyboard = [&H6F1D2B61,&HD5A0,&H11CF,[&HBF,&HC7,&H44,&H45,&H53,&H54,&H00,&H00]] As GUID
|
---|
47 | Dim GUID_Joystick = [&H6F1D2B70,&HD5A0,&H11CF,[&HBF,&HC7,&H44,&H45,&H53,&H54,&H00,&H00]] As GUID
|
---|
48 | Dim GUID_SysMouseEm = [&H6F1D2B80,&HD5A0,&H11CF,[&HBF,&HC7,&H44,&H45,&H53,&H54,&H00,&H00]] As GUID
|
---|
49 | Dim GUID_SysMouseEm2 = [&H6F1D2B81,&HD5A0,&H11CF,[&HBF,&HC7,&H44,&H45,&H53,&H54,&H00,&H00]] As GUID
|
---|
50 | Dim GUID_SysKeyboardEm = [&H6F1D2B82,&HD5A0,&H11CF,[&HBF,&HC7,&H44,&H45,&H53,&H54,&H00,&H00]] As GUID
|
---|
51 | Dim GUID_SysKeyboardEm2 = [&H6F1D2B83,&HD5A0,&H11CF,[&HBF,&HC7,&H44,&H45,&H53,&H54,&H00,&H00]] As GUID
|
---|
52 |
|
---|
53 |
|
---|
54 | Type DIENVELOPE
|
---|
55 | dwSize As DWord
|
---|
56 | dwAttackLevel As DWord
|
---|
57 | dwAttackTime As DWord
|
---|
58 | dwFadeLevel As DWord
|
---|
59 | dwFadeTime As DWord
|
---|
60 | End Type
|
---|
61 | TypeDef LPDIENVELOPE = *DIENVELOPE
|
---|
62 |
|
---|
63 |
|
---|
64 | Type DIEFFECT
|
---|
65 | dwSize As DWord
|
---|
66 | dwFlags As DWord
|
---|
67 | dwDuration As DWord
|
---|
68 | dwSamplePeriod As DWord
|
---|
69 | dwGain As DWord
|
---|
70 | dwTriggerButton As DWord
|
---|
71 | dwTriggerRepeatInterval As DWord
|
---|
72 | cAxes As DWord
|
---|
73 | rgdwAxes As *DWord
|
---|
74 | rglDirection As *Long
|
---|
75 | lpEnvelope As LPDIENVELOPE
|
---|
76 | cbTypeSpecificParams As DWord
|
---|
77 | lpvTypeSpecificParams As VoidPtr
|
---|
78 | dwStartDelay As DWord
|
---|
79 | End Type
|
---|
80 | TypeDef LPDIEFFECT = *DIEFFECT
|
---|
81 |
|
---|
82 |
|
---|
83 | Type DIFILEEFFECT
|
---|
84 | dwSize As DWord
|
---|
85 | GuidEffect As GUID
|
---|
86 | lpDiEffect As LPDIEFFECT
|
---|
87 | szFriendlyName[MAX_PATH-1] As Char
|
---|
88 | End Type
|
---|
89 | TypeDef LPDIFILEEFFECT = *DIFILEEFFECT
|
---|
90 |
|
---|
91 |
|
---|
92 | Type DIEFFESCAPE
|
---|
93 | dwSize As DWord
|
---|
94 | dwCommand As DWord
|
---|
95 | lpvInBuffer As VoidPtr
|
---|
96 | cbInBuffer As DWord
|
---|
97 | lpvOutBuffer As VoidPtr
|
---|
98 | cbOutBuffer As DWord
|
---|
99 | End Type
|
---|
100 | TypeDef LPDIEFFESCAPE = *DIEFFESCAPE
|
---|
101 |
|
---|
102 |
|
---|
103 | Class IDirectInputEffect
|
---|
104 | Inherits IUnknown
|
---|
105 | Public
|
---|
106 | 'IDirectInputEffect methods
|
---|
107 | Abstract Function Initialize(hinst As HINSTANCE, dwVersion As DWord, ByRef rguid As GUID) As DWord
|
---|
108 | Abstract Function GetEffectGuid(pguid As *GUID) As DWord
|
---|
109 | Abstract Function GetParameters(peff As LPDIEFFECT, dwFlags As DWord) As DWord
|
---|
110 | Abstract Function SetParameters(peff As LPDIEFFECT, dwFlags As DWord) As DWord
|
---|
111 | Abstract Function Start(dwIterations As DWord, dwFlags As DWord) As DWord
|
---|
112 | Abstract Function Stop() As DWord
|
---|
113 | Abstract Function GetEffectStatus(pdwFlags As *DWord) As DWord
|
---|
114 | Abstract Function Download() As DWord
|
---|
115 | Abstract Function Unload() As DWord
|
---|
116 | Abstract Function Escape(pesc As LPDIEFFESCAPE) As DWord
|
---|
117 | End Class
|
---|
118 | TypeDef LPDIRECTINPUTEFFECT = *IDirectInputEffect
|
---|
119 |
|
---|
120 |
|
---|
121 | Type DIDEVCAPS
|
---|
122 | dwSize As DWord
|
---|
123 | dwFlags As DWord
|
---|
124 | dwDevType As DWord
|
---|
125 | dwAxes As DWord
|
---|
126 | dwButtons As DWord
|
---|
127 | dwPOVs As DWord
|
---|
128 | dwFFSamplePeriod As DWord
|
---|
129 | dwFFMinTimeResolution As DWord
|
---|
130 | dwFirmwareRevision As DWord
|
---|
131 | dwHardwareRevision As DWord
|
---|
132 | dwFFDriverVersion As DWord
|
---|
133 | End Type
|
---|
134 | TypeDef LPDIDEVCAPS = *DIDEVCAPS
|
---|
135 |
|
---|
136 |
|
---|
137 | Const DIDOI_FFACTUATOR = &H00000001
|
---|
138 | Const DIDOI_FFEFFECTTRIGGER = &H00000002
|
---|
139 | Const DIDOI_POLLED = &H00008000
|
---|
140 | Const DIDOI_ASPECTPOSITION = &H00000100
|
---|
141 | Const DIDOI_ASPECTVELOCITY = &H00000200
|
---|
142 | Const DIDOI_ASPECTACCEL = &H00000300
|
---|
143 | Const DIDOI_ASPECTFORCE = &H00000400
|
---|
144 | Const DIDOI_ASPECTMASK = &H00000F00
|
---|
145 | Const DIDOI_GUIDISUSAGE = &H00010000
|
---|
146 | Type DIOBJECTDATAFORMAT
|
---|
147 | pguid As *GUID
|
---|
148 | dwOfs As DWord
|
---|
149 | dwType As DWord
|
---|
150 | dwFlags As DWord
|
---|
151 | End Type
|
---|
152 | TypeDef LPDIOBJECTDATAFORMAT = *DIOBJECTDATAFORMAT
|
---|
153 |
|
---|
154 |
|
---|
155 | Const DIDFT_ALL = &H00000000
|
---|
156 | Const DIDFT_RELAXIS = &H00000001
|
---|
157 | Const DIDFT_ABSAXIS = &H00000002
|
---|
158 | Const DIDFT_AXIS = &H00000003
|
---|
159 | Const DIDFT_PSHBUTTON = &H00000004
|
---|
160 | Const DIDFT_TGLBUTTON = &H00000008
|
---|
161 | Const DIDFT_BUTTON = &H0000000C
|
---|
162 | Const DIDFT_POV = &H00000010
|
---|
163 | Const DIDFT_COLLECTION = &H00000040
|
---|
164 | Const DIDFT_NODATA = &H00000080
|
---|
165 | Const DIDFT_ANYINSTANCE = &H00FFFF00
|
---|
166 | Const DIDFT_INSTANCEMASK = DIDFT_ANYINSTANCE
|
---|
167 | Const DIDFT_FFACTUATOR = &H01000000
|
---|
168 | Const DIDFT_FFEFFECTTRIGGER = &H02000000
|
---|
169 | Const DIDFT_OUTPUT = &H10000000
|
---|
170 | Const DIDFT_VENDORDEFINED = &H04000000
|
---|
171 | Const DIDFT_ALIAS = &H08000000
|
---|
172 | Const DIDFT_OPTIONAL = &H80000000
|
---|
173 | Const DIDFT_NOCOLLECTION = &H00FFFF00
|
---|
174 | Type DIDATAFORMAT
|
---|
175 | dwSize As DWord
|
---|
176 | dwObjSize As DWord
|
---|
177 | dwFlags As DWord
|
---|
178 | dwDataSize As DWord
|
---|
179 | dwNumObjs As DWord
|
---|
180 | rgodf As LPDIOBJECTDATAFORMAT
|
---|
181 | End Type
|
---|
182 | TypeDef LPDIDATAFORMAT = *DIDATAFORMAT
|
---|
183 |
|
---|
184 | Const DIDF_ABSAXIS = &H00000001
|
---|
185 | Const DIDF_RELAXIS = &H00000002
|
---|
186 |
|
---|
187 |
|
---|
188 | Type DIACTION
|
---|
189 | uAppData As DWord
|
---|
190 | dwSemantic As DWord
|
---|
191 | dwFlags As DWord
|
---|
192 | lptszActionName As *Char
|
---|
193 | guidInstance As GUID
|
---|
194 | dwObjID As DWord
|
---|
195 | dwHow As DWord
|
---|
196 | End Type
|
---|
197 | TypeDef LPDIACTION = *DIACTION
|
---|
198 |
|
---|
199 |
|
---|
200 | Type DIACTIONFORMAT
|
---|
201 | dwSize As DWord
|
---|
202 | dwActionSize As DWord
|
---|
203 | dwDataSize As DWord
|
---|
204 | dwNumActions As DWord
|
---|
205 | rgoAction As LPDIACTION
|
---|
206 | guidActionMap As GUID
|
---|
207 | dwGenre As DWord
|
---|
208 | dwBufferSize As DWord
|
---|
209 | lAxisMin As Long
|
---|
210 | lAxisMax As Long
|
---|
211 | hInstString As HINSTANCE
|
---|
212 | ftTimeStamp As FILETIME
|
---|
213 | dwCRC As DWord
|
---|
214 | tszActionMap[MAX_PATH-1] As Char
|
---|
215 | End Type
|
---|
216 | TypeDef LPDIACTIONFORMAT = *DIACTIONFORMAT
|
---|
217 |
|
---|
218 |
|
---|
219 | Type DICOLORSET
|
---|
220 | dwSize As DWord
|
---|
221 | cTextFore As D3DCOLOR
|
---|
222 | cTextHighlight As D3DCOLOR
|
---|
223 | cCalloutLine As D3DCOLOR
|
---|
224 | cCalloutHighlight As D3DCOLOR
|
---|
225 | cBorder As D3DCOLOR
|
---|
226 | cControlFill As D3DCOLOR
|
---|
227 | cHighlightFill As D3DCOLOR
|
---|
228 | cAreaFill As D3DCOLOR
|
---|
229 | End Type
|
---|
230 |
|
---|
231 |
|
---|
232 | Type DICONFIGUREDEVICESPARAMS
|
---|
233 | dwSize As DWord
|
---|
234 | dwcUsers As DWord
|
---|
235 | lptszUserNames As *Char
|
---|
236 | dwcFormats As DWord
|
---|
237 | lprgFormats As LPDIACTIONFORMAT
|
---|
238 | hwnd As HWND
|
---|
239 | dics As DICOLORSET
|
---|
240 | lpUnkDDSTarget As *IUnknown
|
---|
241 | End Type
|
---|
242 | TypeDef LPDICONFIGUREDEVICESPARAMS = *DICONFIGUREDEVICESPARAMS
|
---|
243 |
|
---|
244 |
|
---|
245 | Type DIDEVICEIMAGEINFO
|
---|
246 | tszImagePath[MAX_PATH-1] As Char
|
---|
247 | dwFlags As DWord
|
---|
248 | dwViewID As DWord
|
---|
249 | rcOverlay As RECT
|
---|
250 | dwObjID As DWord
|
---|
251 | dwcValidPts As DWord
|
---|
252 | rgptCalloutLine[5-1] As POINTAPI
|
---|
253 | rcCalloutRect As RECT
|
---|
254 | dwTextAlign As DWord
|
---|
255 | End Type
|
---|
256 | TypeDef LPDIDEVICEIMAGEINFO = *DIDEVICEIMAGEINFO
|
---|
257 |
|
---|
258 |
|
---|
259 | Type DIDEVICEIMAGEINFOHEADER
|
---|
260 | dwSize As DWord
|
---|
261 | dwSizeImageInfo As DWord
|
---|
262 | dwcViews As DWord
|
---|
263 | dwcButtons As DWord
|
---|
264 | dwcAxes As DWord
|
---|
265 | dwcPOVs As DWord
|
---|
266 | dwBufferSize As DWord
|
---|
267 | dwBufferUsed As DWord
|
---|
268 | lprgImageInfoArray As LPDIDEVICEIMAGEINFO
|
---|
269 | End Type
|
---|
270 | TypeDef LPDIDEVICEIMAGEINFOHEADER = *DIDEVICEIMAGEINFOHEADER
|
---|
271 |
|
---|
272 |
|
---|
273 | Type DIDEVICEOBJECTINSTANCE
|
---|
274 | dwSize As DWord
|
---|
275 | guidType As GUID
|
---|
276 | dwOfs As DWord
|
---|
277 | dwType As DWord
|
---|
278 | dwFlags As DWord
|
---|
279 | tszName[MAX_PATH-1] As Char
|
---|
280 | dwFFMaxForce As DWord
|
---|
281 | dwFFForceResolution As DWord
|
---|
282 | wCollectionNumber As Word
|
---|
283 | wDesignatorIndex As Word
|
---|
284 | wUsagePage As Word
|
---|
285 | wUsage As Word
|
---|
286 | dwDimension As DWord
|
---|
287 | wExponent As Word
|
---|
288 | wReportId As Word
|
---|
289 | End Type
|
---|
290 | TypeDef LPDIDEVICEOBJECTINSTANCE = *DIDEVICEOBJECTINSTANCE
|
---|
291 |
|
---|
292 |
|
---|
293 | Type DIPROPHEADER
|
---|
294 | dwSize As DWord
|
---|
295 | dwHeaderSize As DWord
|
---|
296 | dwObj As DWord
|
---|
297 | dwHow As DWord
|
---|
298 | End Type
|
---|
299 | TypeDef LPDIPROPHEADER = *DIPROPHEADER
|
---|
300 |
|
---|
301 |
|
---|
302 | Type DIDEVICEOBJECTDATA
|
---|
303 | dwOfs As DWord
|
---|
304 | dwData As DWord
|
---|
305 | dwTimeStamp As DWord
|
---|
306 | dwSequence As DWord
|
---|
307 | uAppData As DWord
|
---|
308 | End Type
|
---|
309 | TypeDef LPDIDEVICEOBJECTDATA = *DIDEVICEOBJECTDATA
|
---|
310 |
|
---|
311 |
|
---|
312 | Const DISCL_EXCLUSIVE = &H00000001
|
---|
313 | Const DISCL_NONEXCLUSIVE = &H00000002
|
---|
314 | Const DISCL_FOREGROUND = &H00000004
|
---|
315 | Const DISCL_BACKGROUND = &H00000008
|
---|
316 | Const DISCL_NOWINKEY = &H00000010
|
---|
317 |
|
---|
318 |
|
---|
319 | Type DIDEVICEINSTANCE
|
---|
320 | dwSize As DWord
|
---|
321 | guidInstance As GUID
|
---|
322 | guidProduct As GUID
|
---|
323 | dwDevType As DWord
|
---|
324 | tszInstanceName[MAX_PATH-1] As Char
|
---|
325 | tszProductName[MAX_PATH-1] As Char
|
---|
326 | guidFFDriver As GUID
|
---|
327 | wUsagePage As Word
|
---|
328 | wUsage As Word
|
---|
329 | End Type
|
---|
330 | TypeDef LPDIDEVICEINSTANCE = *DIDEVICEINSTANCE
|
---|
331 |
|
---|
332 |
|
---|
333 | Type DIEFFECTINFO
|
---|
334 | dwSize As DWord
|
---|
335 | guid As GUID
|
---|
336 | dwEffType As DWord
|
---|
337 | dwStaticParams As DWord
|
---|
338 | dwDynamicParams As DWord
|
---|
339 | tszName[MAX_PATH-1] As Char
|
---|
340 | End Type
|
---|
341 | TypeDef LPDIEFFECTINFO = *DIEFFECTINFO
|
---|
342 |
|
---|
343 |
|
---|
344 | Class IDirectInputDevice8
|
---|
345 | Inherits IUnknown
|
---|
346 | Public
|
---|
347 | 'IDirectInputDevice8 methods
|
---|
348 | Abstract Function GetCapabilities(lpDIDevCaps As LPDIDEVCAPS) As DWord
|
---|
349 | Abstract Function EnumObjects(lpCallback As VoidPtr, pvRef As VoidPtr, dwFlags As DWord) As DWord
|
---|
350 | Abstract Function GetProperty(ByRef rguidProp As GUID, pdiph As LPDIPROPHEADER) As DWord
|
---|
351 | Abstract Function SetProperty(ByRef rguidProp As GUID, pdiph As LPDIPROPHEADER) As DWord
|
---|
352 | Abstract Function Acquire() As DWord
|
---|
353 | Abstract Function Unacquire() As DWord
|
---|
354 | Abstract Function GetDeviceState(cbData As DWord, lpvData As VoidPtr) As DWord
|
---|
355 | Abstract Function GetDeviceData(cbObjectData As DWord, rgdod As LPDIDEVICEOBJECTDATA, pdwInOut As *DWord, dwFlags As DWord) As DWord
|
---|
356 | Abstract Function SetDataFormat(lpdf As LPDIDATAFORMAT) As DWord
|
---|
357 | Abstract Function SetEventNotification(hEvent As HANDLE) As DWord
|
---|
358 | Abstract Function SetCooperativeLevel(hwnd As HWND, dwFlags As DWord) As DWord
|
---|
359 | Abstract Function GetObjectInfo(pdidoi As LPDIDEVICEOBJECTINSTANCE, dwObj As DWord, dwHow As DWord) As DWord
|
---|
360 | Abstract Function GetDeviceInfo(pdidi As LPDIDEVICEINSTANCE) As DWord
|
---|
361 | Abstract Function RunControlPanel(hwndOwner As HWND, dwFlags As DWord) As DWord
|
---|
362 | Abstract Function Initialize(hinst As HINSTANCE, dwVersion As DWord, ByRef rguid As GUID) As DWord
|
---|
363 | Abstract Function CreateEffect(ByRef rguid As GUID, lpeff As LPDIEFFECT, ppdeff As *LPDIRECTINPUTEFFECT, punkOuter As LPUNKNOWN) As DWord
|
---|
364 | Abstract Function EnumEffects(lpCallback As VoidPtr, pvRef As VoidPtr, dwEffType As DWord) As DWord
|
---|
365 | Abstract Function GetEffectInfo(pdei As LPDIEFFECTINFO, ByRef rguid As GUID) As DWord
|
---|
366 | Abstract Function GetForceFeedbackState(pdwOut As *DWord) As DWord
|
---|
367 | Abstract Function SendForceFeedbackCommand(dwFlags As DWord) As DWord
|
---|
368 | Abstract Function EnumCreatedEffectObjects(lpCallback As VoidPtr, pvRef As VoidPtr, fl As DWord) As DWord
|
---|
369 | Abstract Function Escape(pesc As LPDIEFFESCAPE) As DWord
|
---|
370 | Abstract Function Poll() As DWord
|
---|
371 | Abstract Function SendDeviceData(cbObjectData As DWord, rgdod As LPDIDEVICEOBJECTDATA, pdwInOut As *DWord, fl As DWord) As DWord
|
---|
372 | Abstract Function EnumEffectsInFile(lpszFileName As *Char, pec As VoidPtr, pvRef As VoidPtr, dwFlags As DWord) As DWord
|
---|
373 | Abstract Function WriteEffectToFile(lpszFileName As *Char, dwEntries As DWord, rgDiFileEft As LPDIFILEEFFECT, dwFlags As DWord) As DWord
|
---|
374 | Abstract Function BuildActionMap(lpdiaf As LPDIACTIONFORMAT, lpszUserName As *Char, dwFlags As DWord) As DWord
|
---|
375 | Abstract Function SetActionMap(lpdiActionFormat As LPDIACTIONFORMAT, lptszUserName As *Char, dwFlags As DWord) As DWord
|
---|
376 | Abstract Function GetImageInfo(lpdiDevImageInfoHeader As LPDIDEVICEIMAGEINFOHEADER) As DWord
|
---|
377 | End Class
|
---|
378 | TypeDef LPDIRECTINPUTDEVICE8 = *IDirectInputDevice8
|
---|
379 |
|
---|
380 |
|
---|
381 | Class IDirectInput8
|
---|
382 | Inherits IUnknown
|
---|
383 | Public
|
---|
384 | 'IDirectInput8 methods
|
---|
385 | Abstract Function CreateDevice(ByRef rguid As GUID, lplpDirectInputDevice As *LPDIRECTINPUTDEVICE8, pUnkOuter As LPUNKNOWN) As DWord
|
---|
386 | Abstract Function EnumDevices(dwDevType As DWord, lpCallback As VoidPtr, pvRef As VoidPtr, dwFlags As DWord) As DWord
|
---|
387 | Abstract Function GetDeviceStatus(ByRef rguidInstance As GUID) As DWord
|
---|
388 | Abstract Function RunControlPanel(hwndOwner As HWND, dwFlags As DWord) As DWord
|
---|
389 | Abstract Function Initialize(hinst As HINSTANCE, dwVersion As DWord) As DWord
|
---|
390 | Abstract Function FindDevice(ByRef rguidClass As GUID, ptszName As *Char, pguidInstance As *GUID) As DWord
|
---|
391 | Abstract Function EnumDevicesBySemantics(ptszUserName As *Char, lpdiActionFormat As LPDIACTIONFORMAT, lpCallback As VoidPtr, pvRef As VoidPtr, dwFlags As DWord) As DWord
|
---|
392 | Abstract Function ConfigureDevices(lpdiCallback As VoidPtr, lpdiCDParams As LPDICONFIGUREDEVICESPARAMS, dwFlags As DWord, pvRefData As VoidPtr) As DWord
|
---|
393 | End Class
|
---|
394 | TypeDef LPDIRECTINPUT8 = *IDirectInput8
|
---|
395 |
|
---|
396 |
|
---|
397 | '---------------------------------
|
---|
398 | ' DirectInput keyboard scan codes
|
---|
399 | '---------------------------------
|
---|
400 |
|
---|
401 | Const DIK_ESCAPE = &H01
|
---|
402 | Const DIK_1 = &H02
|
---|
403 | Const DIK_2 = &H03
|
---|
404 | Const DIK_3 = &H04
|
---|
405 | Const DIK_4 = &H05
|
---|
406 | Const DIK_5 = &H06
|
---|
407 | Const DIK_6 = &H07
|
---|
408 | Const DIK_7 = &H08
|
---|
409 | Const DIK_8 = &H09
|
---|
410 | Const DIK_9 = &H0A
|
---|
411 | Const DIK_0 = &H0B
|
---|
412 | Const DIK_MINUS = &H0C '- on main keyboard
|
---|
413 | Const DIK_EQUALS = &H0D
|
---|
414 | Const DIK_BACK = &H0E 'backspace
|
---|
415 | Const DIK_TAB = &H0F
|
---|
416 | Const DIK_Q = &H10
|
---|
417 | Const DIK_W = &H11
|
---|
418 | Const DIK_E = &H12
|
---|
419 | Const DIK_R = &H13
|
---|
420 | Const DIK_T = &H14
|
---|
421 | Const DIK_Y = &H15
|
---|
422 | Const DIK_U = &H16
|
---|
423 | Const DIK_I = &H17
|
---|
424 | Const DIK_O = &H18
|
---|
425 | Const DIK_P = &H19
|
---|
426 | Const DIK_LBRACKET = &H1A
|
---|
427 | Const DIK_RBRACKET = &H1B
|
---|
428 | Const DIK_RETURN = &H1C 'Enter on main keyboard
|
---|
429 | Const DIK_LCONTROL = &H1D
|
---|
430 | Const DIK_A = &H1E
|
---|
431 | Const DIK_S = &H1F
|
---|
432 | Const DIK_D = &H20
|
---|
433 | Const DIK_F = &H21
|
---|
434 | Const DIK_G = &H22
|
---|
435 | Const DIK_H = &H23
|
---|
436 | Const DIK_J = &H24
|
---|
437 | Const DIK_K = &H25
|
---|
438 | Const DIK_L = &H26
|
---|
439 | Const DIK_SEMICOLON = &H27
|
---|
440 | Const DIK_APOSTROPHE = &H28
|
---|
441 | Const DIK_GRAVE = &H29 'accent grave
|
---|
442 | Const DIK_LSHIFT = &H2A
|
---|
443 | Const DIK_BACKSLASH = &H2B
|
---|
444 | Const DIK_Z = &H2C
|
---|
445 | Const DIK_X = &H2D
|
---|
446 | Const DIK_C = &H2E
|
---|
447 | Const DIK_V = &H2F
|
---|
448 | Const DIK_B = &H30
|
---|
449 | Const DIK_N = &H31
|
---|
450 | Const DIK_M = &H32
|
---|
451 | Const DIK_COMMA = &H33
|
---|
452 | Const DIK_PERIOD = &H34 '. on main keyboard
|
---|
453 | Const DIK_SLASH = &H35 '/ on main keyboard
|
---|
454 | Const DIK_RSHIFT = &H36
|
---|
455 | Const DIK_MULTIPLY = &H37 '* on numeric keypad
|
---|
456 | Const DIK_LMENU = &H38 'left Alt
|
---|
457 | Const DIK_SPACE = &H39
|
---|
458 | Const DIK_CAPITAL = &H3A
|
---|
459 | Const DIK_F1 = &H3B
|
---|
460 | Const DIK_F2 = &H3C
|
---|
461 | Const DIK_F3 = &H3D
|
---|
462 | Const DIK_F4 = &H3E
|
---|
463 | Const DIK_F5 = &H3F
|
---|
464 | Const DIK_F6 = &H40
|
---|
465 | Const DIK_F7 = &H41
|
---|
466 | Const DIK_F8 = &H42
|
---|
467 | Const DIK_F9 = &H43
|
---|
468 | Const DIK_F10 = &H44
|
---|
469 | Const DIK_NUMLOCK = &H45
|
---|
470 | Const DIK_SCROLL = &H46 'Scroll Lock
|
---|
471 | Const DIK_NUMPAD7 = &H47
|
---|
472 | Const DIK_NUMPAD8 = &H48
|
---|
473 | Const DIK_NUMPAD9 = &H49
|
---|
474 | Const DIK_SUBTRACT = &H4A '- on numeric keypad
|
---|
475 | Const DIK_NUMPAD4 = &H4B
|
---|
476 | Const DIK_NUMPAD5 = &H4C
|
---|
477 | Const DIK_NUMPAD6 = &H4D
|
---|
478 | Const DIK_ADD = &H4E '+ on numeric keypad
|
---|
479 | Const DIK_NUMPAD1 = &H4F
|
---|
480 | Const DIK_NUMPAD2 = &H50
|
---|
481 | Const DIK_NUMPAD3 = &H51
|
---|
482 | Const DIK_NUMPAD0 = &H52
|
---|
483 | Const DIK_DECIMAL = &H53 '. on numeric keypad
|
---|
484 | Const DIK_OEM_102 = &H56 '<> or \| on RT 102-key keyboard (Non-U.S.)
|
---|
485 | Const DIK_F11 = &H57
|
---|
486 | Const DIK_F12 = &H58
|
---|
487 | Const DIK_F13 = &H64 ' (NEC PC98)
|
---|
488 | Const DIK_F14 = &H65 ' (NEC PC98)
|
---|
489 | Const DIK_F15 = &H66 ' (NEC PC98)
|
---|
490 | Const DIK_KANA = &H70 '(Japanese keyboard)
|
---|
491 | Const DIK_ABNT_C1 = &H73 '/? on Brazilian keyboard
|
---|
492 | Const DIK_CONVERT = &H79 '(Japanese keyboard)
|
---|
493 | Const DIK_NOCONVERT = &H7B '(Japanese keyboard)
|
---|
494 | Const DIK_YEN = &H7D '(Japanese keyboard)
|
---|
495 | Const DIK_ABNT_C2 = &H7E 'Numpad . on Brazilian keyboard
|
---|
496 | Const DIK_NUMPADEQUALS = &H8D '= on numeric keypad (NEC PC98)
|
---|
497 | Const DIK_PREVTRACK = &H90 'Previous Track (DIK_CIRCUMFLEX on Japanese keyboard)
|
---|
498 | Const DIK_AT = &H91 ' (NEC PC98)
|
---|
499 | Const DIK_COLON = &H92 ' (NEC PC98)
|
---|
500 | Const DIK_UNDERLINE = &H93 ' (NEC PC98)
|
---|
501 | Const DIK_KANJI = &H94 '(Japanese keyboard)
|
---|
502 | Const DIK_STOP = &H95 ' (NEC PC98)
|
---|
503 | Const DIK_AX = &H96 ' (Japan AX)
|
---|
504 | Const DIK_UNLABELED = &H97 ' (J3100)
|
---|
505 | Const DIK_NEXTTRACK = &H99 'Next Track
|
---|
506 | Const DIK_NUMPADENTER = &H9C 'Enter on numeric keypad
|
---|
507 | Const DIK_RCONTROL = &H9D
|
---|
508 | Const DIK_MUTE = &HA0 'Mute
|
---|
509 | Const DIK_CALCULATOR = &HA1 'Calculator
|
---|
510 | Const DIK_PLAYPAUSE = &HA2 'Play / Pause
|
---|
511 | Const DIK_MEDIASTOP = &HA4 'Media Stop
|
---|
512 | Const DIK_VOLUMEDOWN = &HAE 'Volume -
|
---|
513 | Const DIK_VOLUMEUP = &HB0 'Volume +
|
---|
514 | Const DIK_WEBHOME = &HB2 'Web home
|
---|
515 | Const DIK_NUMPADCOMMA = &HB3 ', on numeric keypad (NEC PC98)
|
---|
516 | Const DIK_DIVIDE = &HB5 '/ on numeric keypad
|
---|
517 | Const DIK_SYSRQ = &HB7
|
---|
518 | Const DIK_RMENU = &HB8 'right Alt
|
---|
519 | Const DIK_PAUSE = &HC5 'Pause
|
---|
520 | Const DIK_HOME = &HC7 'Home on arrow keypad
|
---|
521 | Const DIK_UP = &HC8 'UpArrow on arrow keypad
|
---|
522 | Const DIK_PRIOR = &HC9 'PgUp on arrow keypad
|
---|
523 | Const DIK_LEFT = &HCB 'LeftArrow on arrow keypad
|
---|
524 | Const DIK_RIGHT = &HCD 'RightArrow on arrow keypad
|
---|
525 | Const DIK_END = &HCF 'End on arrow keypad
|
---|
526 | Const DIK_DOWN = &HD0 'DownArrow on arrow keypad
|
---|
527 | Const DIK_NEXT = &HD1 'PgDn on arrow keypad
|
---|
528 | Const DIK_INSERT = &HD2 'Insert on arrow keypad
|
---|
529 | Const DIK_DELETE = &HD3 'Delete on arrow keypad
|
---|
530 | Const DIK_LWIN = &HDB 'Left Windows key
|
---|
531 | Const DIK_RWIN = &HDC 'Right Windows key
|
---|
532 | Const DIK_APPS = &HDD 'AppMenu key
|
---|
533 | Const DIK_POWER = &HDE 'System Power
|
---|
534 | Const DIK_SLEEP = &HDF 'System Sleep
|
---|
535 | Const DIK_WAKE = &HE3 'System Wake
|
---|
536 | Const DIK_WEBSEARCH = &HE5 'Web Search
|
---|
537 | Const DIK_WEBFAVORITES = &HE6 'Web Favorites
|
---|
538 | Const DIK_WEBREFRESH = &HE7 'Web Refresh
|
---|
539 | Const DIK_WEBSTOP = &HE8 'Web Stop
|
---|
540 | Const DIK_WEBFORWARD = &HE9 'Web Forward
|
---|
541 | Const DIK_WEBBACK = &HEA 'Web Back
|
---|
542 | Const DIK_MYCOMPUTER = &HEB 'My Computer
|
---|
543 | Const DIK_MAIL = &HEC 'Mail
|
---|
544 | Const DIK_MEDIASELECT = &HED 'Media Select
|
---|
545 |
|
---|
546 | ' Alternate names for keys, to facilitate transition from DOS.
|
---|
547 | Const DIK_BACKSPACE = DIK_BACK 'backspace
|
---|
548 | Const DIK_NUMPADSTAR = DIK_MULTIPLY '* on numeric keypad
|
---|
549 | Const DIK_LALT = DIK_LMENU 'left Alt
|
---|
550 | Const DIK_CAPSLOCK = DIK_CAPITAL 'CapsLock
|
---|
551 | Const DIK_NUMPADMINUS = DIK_SUBTRACT '- on numeric keypad
|
---|
552 | Const DIK_NUMPADPLUS = DIK_ADD '+ on numeric keypad
|
---|
553 | Const DIK_NUMPADPERIOD = DIK_DECIMAL '. on numeric keypad
|
---|
554 | Const DIK_NUMPADSLASH = DIK_DIVIDE '/ on numeric keypad
|
---|
555 | Const DIK_RALT = DIK_RMENU 'right Alt
|
---|
556 | Const DIK_UPARROW = DIK_UP 'UpArrow on arrow keypad
|
---|
557 | Const DIK_PGUP = DIK_PRIOR 'PgUp on arrow keypad
|
---|
558 | Const DIK_LEFTARROW = DIK_LEFT 'LeftArrow on arrow keypad
|
---|
559 | Const DIK_RIGHTARROW = DIK_RIGHT 'RightArrow on arrow keypad
|
---|
560 | Const DIK_DOWNARROW = DIK_DOWN 'DownArrow on arrow keypad
|
---|
561 | Const DIK_PGDN = DIK_NEXT 'PgDn on arrow keypad
|
---|
562 |
|
---|
563 | ' Alternate names for keys originally not used on US keyboards.
|
---|
564 | Const DIK_CIRCUMFLEX = DIK_PREVTRACK 'Japanese keyboard
|
---|
565 |
|
---|
566 |
|
---|
567 | '-----------------------
|
---|
568 | ' Mouse
|
---|
569 | '-----------------------
|
---|
570 |
|
---|
571 | Type DIMOUSESTATE
|
---|
572 | lX As Long
|
---|
573 | lY As Long
|
---|
574 | lZ As Long
|
---|
575 | rgbButtons[3] As Byte
|
---|
576 | End Type
|
---|
577 |
|
---|
578 | Type DIMOUSESTATE2
|
---|
579 | lX As Long
|
---|
580 | lY As Long
|
---|
581 | lZ As Long
|
---|
582 | rgbButtons[7] As Byte
|
---|
583 | End Type
|
---|
584 |
|
---|
585 |
|
---|
586 | Declare Function DirectInput8Create Lib "dinput8" (hinst As HINSTANCE, dwVersion As DWord, ByRef riidltf As GUID, ppvOut As *DWord, punkOuter As *IUnknown) As DWord
|
---|
587 |
|
---|
588 |
|
---|
589 | '-------------------
|
---|
590 | ' Device Data Type
|
---|
591 | '-------------------
|
---|
592 |
|
---|
593 | 'c_dfDIKeyboard
|
---|
594 | Sub _System_DirectInput_Keyboard_SetDataType(p As *DIOBJECTDATAFORMAT)
|
---|
595 | Dim i As Long
|
---|
596 | For i=0 To 255
|
---|
597 | p[i].pguid=VarPtr(GUID_Key)
|
---|
598 | p[i].dwOfs=i
|
---|
599 | p[i].dwType=DIDFT_BUTTON or DIDFT_OPTIONAL or (i<<8)
|
---|
600 | p[i].dwFlags=0
|
---|
601 | Next
|
---|
602 | End Sub
|
---|
603 | Dim _System_dfDIKeyboardObjectDataFormat[255] As DIOBJECTDATAFORMAT
|
---|
604 | _System_DirectInput_Keyboard_SetDataType(_System_dfDIKeyboardObjectDataFormat)
|
---|
605 | Dim c_dfDIKeyboard=[24,16,DIDF_RELAXIS,256,256,0] As DIDATAFORMAT
|
---|
606 | c_dfDIKeyboard.rgodf=_System_dfDIKeyboardObjectDataFormat
|
---|
607 |
|
---|
608 | 'c_dfDIMouse
|
---|
609 | Dim _System_dfDIMouseObjectDataFormat[6]=[
|
---|
610 | [0,&H00,DIDFT_ANYINSTANCE or DIDFT_AXIS,0],
|
---|
611 | [0,&H04,DIDFT_ANYINSTANCE or DIDFT_AXIS,0],
|
---|
612 | [0,&H08,DIDFT_ANYINSTANCE or DIDFT_AXIS or DIDFT_OPTIONAL,0],
|
---|
613 | [0,&H0C,DIDFT_ANYINSTANCE or DIDFT_BUTTON,0],
|
---|
614 | [0,&H0D,DIDFT_ANYINSTANCE or DIDFT_BUTTON,0],
|
---|
615 | [0,&H0E,DIDFT_ANYINSTANCE or DIDFT_BUTTON or DIDFT_OPTIONAL,0],
|
---|
616 | [0,&H0F,DIDFT_ANYINSTANCE or DIDFT_BUTTON or DIDFT_OPTIONAL,0]
|
---|
617 | ] As DIOBJECTDATAFORMAT
|
---|
618 | _System_dfDIMouseObjectDataFormat[0].pguid=VarPtr(GUID_XAxis)
|
---|
619 | _System_dfDIMouseObjectDataFormat[1].pguid=VarPtr(GUID_YAxis)
|
---|
620 | _System_dfDIMouseObjectDataFormat[2].pguid=VarPtr(GUID_ZAxis)
|
---|
621 | Dim c_dfDIMouse=[24,16,DIDF_RELAXIS,16,7,0] As DIDATAFORMAT
|
---|
622 | c_dfDIMouse.rgodf=_System_dfDIMouseObjectDataFormat
|
---|
623 |
|
---|
624 | 'c_dfDIMouse2
|
---|
625 | Dim _System_dfDIMouse2ObjectDataFormat[10]=[
|
---|
626 | [0,&H00,DIDFT_ANYINSTANCE or DIDFT_AXIS,0],
|
---|
627 | [0,&H04,DIDFT_ANYINSTANCE or DIDFT_AXIS,0],
|
---|
628 | [0,&H08,DIDFT_ANYINSTANCE or DIDFT_AXIS or DIDFT_OPTIONAL,0],
|
---|
629 | [0,&H0C,DIDFT_ANYINSTANCE or DIDFT_BUTTON,0],
|
---|
630 | [0,&H0D,DIDFT_ANYINSTANCE or DIDFT_BUTTON,0],
|
---|
631 | [0,&H0E,DIDFT_ANYINSTANCE or DIDFT_BUTTON or DIDFT_OPTIONAL,0],
|
---|
632 | [0,&H0F,DIDFT_ANYINSTANCE or DIDFT_BUTTON or DIDFT_OPTIONAL,0],
|
---|
633 | [0,&H10,DIDFT_ANYINSTANCE or DIDFT_BUTTON or DIDFT_OPTIONAL,0],
|
---|
634 | [0,&H11,DIDFT_ANYINSTANCE or DIDFT_BUTTON or DIDFT_OPTIONAL,0],
|
---|
635 | [0,&H12,DIDFT_ANYINSTANCE or DIDFT_BUTTON or DIDFT_OPTIONAL,0],
|
---|
636 | [0,&H13,DIDFT_ANYINSTANCE or DIDFT_BUTTON or DIDFT_OPTIONAL,0]
|
---|
637 | ] As DIOBJECTDATAFORMAT
|
---|
638 | _System_dfDIMouse2ObjectDataFormat[0].pguid=VarPtr(GUID_XAxis)
|
---|
639 | _System_dfDIMouse2ObjectDataFormat[1].pguid=VarPtr(GUID_YAxis)
|
---|
640 | _System_dfDIMouse2ObjectDataFormat[2].pguid=VarPtr(GUID_ZAxis)
|
---|
641 | Dim c_dfDIMouse2=[24,16,DIDF_RELAXIS,20,11,0] As DIDATAFORMAT
|
---|
642 | c_dfDIMouse2.rgodf=_System_dfDIMouse2ObjectDataFormat
|
---|
643 |
|
---|
644 | 'c_dfDIJoystick
|
---|
645 | Sub _System_DirectInput_Joystick_SetDataType(p As *DIOBJECTDATAFORMAT)
|
---|
646 | Dim i As Long
|
---|
647 | For i=12 To &H2B
|
---|
648 | p[i].pguid=0
|
---|
649 | p[i].dwOfs=&H30+i-12
|
---|
650 | p[i].dwType=DIDFT_ANYINSTANCE or DIDFT_BUTTON or DIDFT_OPTIONAL or (i<<8)
|
---|
651 | p[i].dwFlags=0
|
---|
652 | Next
|
---|
653 | End Sub
|
---|
654 | Dim _System_dfDIJoystickObjectDataFormat[&H2B]=[
|
---|
655 | [0,&H00,DIDFT_ANYINSTANCE or DIDFT_AXIS or DIDFT_OPTIONAL,DIDOI_ASPECTPOSITION],
|
---|
656 | [0,&H04,DIDFT_ANYINSTANCE or DIDFT_AXIS or DIDFT_OPTIONAL,DIDOI_ASPECTPOSITION],
|
---|
657 | [0,&H08,DIDFT_ANYINSTANCE or DIDFT_AXIS or DIDFT_OPTIONAL,DIDOI_ASPECTPOSITION],
|
---|
658 | [0,&H0C,DIDFT_ANYINSTANCE or DIDFT_AXIS or DIDFT_OPTIONAL,DIDOI_ASPECTPOSITION],
|
---|
659 | [0,&H10,DIDFT_ANYINSTANCE or DIDFT_AXIS or DIDFT_OPTIONAL,DIDOI_ASPECTPOSITION],
|
---|
660 | [0,&H14,DIDFT_ANYINSTANCE or DIDFT_AXIS or DIDFT_OPTIONAL,DIDOI_ASPECTPOSITION],
|
---|
661 | [0,&H18,DIDFT_ANYINSTANCE or DIDFT_AXIS or DIDFT_OPTIONAL,DIDOI_ASPECTPOSITION],
|
---|
662 | [0,&H1C,DIDFT_ANYINSTANCE or DIDFT_AXIS or DIDFT_OPTIONAL,DIDOI_ASPECTPOSITION],
|
---|
663 | [0,&H20,DIDFT_ANYINSTANCE or DIDFT_POV or DIDFT_OPTIONAL,0],
|
---|
664 | [0,&H24,DIDFT_ANYINSTANCE or DIDFT_POV or DIDFT_OPTIONAL,0],
|
---|
665 | [0,&H28,DIDFT_ANYINSTANCE or DIDFT_POV or DIDFT_OPTIONAL,0],
|
---|
666 | [0,&H2C,DIDFT_ANYINSTANCE or DIDFT_POV or DIDFT_OPTIONAL,0]
|
---|
667 | ] As DIOBJECTDATAFORMAT
|
---|
668 | _System_dfDIJoystickObjectDataFormat[0].pguid=VarPtr(GUID_XAxis)
|
---|
669 | _System_dfDIJoystickObjectDataFormat[1].pguid=VarPtr(GUID_YAxis)
|
---|
670 | _System_dfDIJoystickObjectDataFormat[2].pguid=VarPtr(GUID_ZAxis)
|
---|
671 | _System_dfDIJoystickObjectDataFormat[3].pguid=VarPtr(GUID_RxAxis)
|
---|
672 | _System_dfDIJoystickObjectDataFormat[4].pguid=VarPtr(GUID_RyAxis)
|
---|
673 | _System_dfDIJoystickObjectDataFormat[5].pguid=VarPtr(GUID_RzAxis)
|
---|
674 | _System_dfDIJoystickObjectDataFormat[6].pguid=VarPtr(GUID_Slider)
|
---|
675 | _System_dfDIJoystickObjectDataFormat[7].pguid=VarPtr(GUID_Slider)
|
---|
676 | _System_dfDIJoystickObjectDataFormat[8].pguid=VarPtr(GUID_POV)
|
---|
677 | _System_dfDIJoystickObjectDataFormat[9].pguid=VarPtr(GUID_POV)
|
---|
678 | _System_dfDIJoystickObjectDataFormat[10].pguid=VarPtr(GUID_POV)
|
---|
679 | _System_dfDIJoystickObjectDataFormat[11].pguid=VarPtr(GUID_POV)
|
---|
680 | _System_DirectInput_Joystick_SetDataType(_System_dfDIJoystickObjectDataFormat)
|
---|
681 | Dim c_dfDIJoystick=[24,16,DIDF_ABSAXIS,&H50,&H2C,0] As DIDATAFORMAT
|
---|
682 | c_dfDIJoystick.rgodf=_System_dfDIJoystickObjectDataFormat
|
---|
683 |
|
---|
684 | 'c_dfDIJoystick2
|
---|
685 | Sub _System_DirectInput_Joystick2_SetDataType(p As *DIOBJECTDATAFORMAT)
|
---|
686 | Dim i As Long
|
---|
687 | For i=12 To &H8B
|
---|
688 | p[i].pguid=0
|
---|
689 | p[i].dwOfs=&H30+i-12
|
---|
690 | p[i].dwType=DIDFT_ANYINSTANCE or DIDFT_BUTTON or DIDFT_OPTIONAL or (i<<8)
|
---|
691 | p[i].dwFlags=0
|
---|
692 | Next
|
---|
693 |
|
---|
694 | With p[&H8C]:.pguid=VarPtr(GUID_XAxis):.dwOfs=&HB0:.dwType=DIDFT_ANYINSTANCE or DIDFT_AXIS or DIDFT_OPTIONAL:.dwFlags=DIDOI_ASPECTVELOCITY:End With
|
---|
695 | With p[&H8D]:.pguid=VarPtr(GUID_YAxis):.dwOfs=&HB4:.dwType=DIDFT_ANYINSTANCE or DIDFT_AXIS or DIDFT_OPTIONAL:.dwFlags=DIDOI_ASPECTVELOCITY:End With
|
---|
696 | With p[&H8E]:.pguid=VarPtr(GUID_ZAxis):.dwOfs=&HB8:.dwType=DIDFT_ANYINSTANCE or DIDFT_AXIS or DIDFT_OPTIONAL:.dwFlags=DIDOI_ASPECTVELOCITY:End With
|
---|
697 | With p[&H8F]:.pguid=VarPtr(GUID_RxAxis):.dwOfs=&HBC:.dwType=DIDFT_ANYINSTANCE or DIDFT_AXIS or DIDFT_OPTIONAL:.dwFlags=DIDOI_ASPECTVELOCITY:End With
|
---|
698 | With p[&H90]:.pguid=VarPtr(GUID_RyAxis):.dwOfs=&HC0:.dwType=DIDFT_ANYINSTANCE or DIDFT_AXIS or DIDFT_OPTIONAL:.dwFlags=DIDOI_ASPECTVELOCITY:End With
|
---|
699 | With p[&H91]:.pguid=VarPtr(GUID_RzAxis):.dwOfs=&HC4:.dwType=DIDFT_ANYINSTANCE or DIDFT_AXIS or DIDFT_OPTIONAL:.dwFlags=DIDOI_ASPECTVELOCITY:End With
|
---|
700 | With p[&H92]:.pguid=VarPtr(GUID_Slider):.dwOfs=&H18:.dwType=DIDFT_ANYINSTANCE or DIDFT_AXIS or DIDFT_OPTIONAL:.dwFlags=DIDOI_ASPECTVELOCITY:End With
|
---|
701 | With p[&H93]:.pguid=VarPtr(GUID_Slider):.dwOfs=&H1C:.dwType=DIDFT_ANYINSTANCE or DIDFT_AXIS or DIDFT_OPTIONAL:.dwFlags=DIDOI_ASPECTVELOCITY:End With
|
---|
702 |
|
---|
703 | With p[&H94]:.pguid=VarPtr(GUID_XAxis):.dwOfs=&HD0:.dwType=DIDFT_ANYINSTANCE or DIDFT_AXIS or DIDFT_OPTIONAL:.dwFlags=DIDOI_ASPECTACCEL:End With
|
---|
704 | With p[&H95]:.pguid=VarPtr(GUID_YAxis):.dwOfs=&HD4:.dwType=DIDFT_ANYINSTANCE or DIDFT_AXIS or DIDFT_OPTIONAL:.dwFlags=DIDOI_ASPECTACCEL:End With
|
---|
705 | With p[&H96]:.pguid=VarPtr(GUID_ZAxis):.dwOfs=&HD8:.dwType=DIDFT_ANYINSTANCE or DIDFT_AXIS or DIDFT_OPTIONAL:.dwFlags=DIDOI_ASPECTACCEL:End With
|
---|
706 | With p[&H97]:.pguid=VarPtr(GUID_RxAxis):.dwOfs=&HDC:.dwType=DIDFT_ANYINSTANCE or DIDFT_AXIS or DIDFT_OPTIONAL:.dwFlags=DIDOI_ASPECTACCEL:End With
|
---|
707 | With p[&H98]:.pguid=VarPtr(GUID_RyAxis):.dwOfs=&HE0:.dwType=DIDFT_ANYINSTANCE or DIDFT_AXIS or DIDFT_OPTIONAL:.dwFlags=DIDOI_ASPECTACCEL:End With
|
---|
708 | With p[&H99]:.pguid=VarPtr(GUID_RzAxis):.dwOfs=&HE4:.dwType=DIDFT_ANYINSTANCE or DIDFT_AXIS or DIDFT_OPTIONAL:.dwFlags=DIDOI_ASPECTACCEL:End With
|
---|
709 | With p[&H9A]:.pguid=VarPtr(GUID_Slider):.dwOfs=&H18:.dwType=DIDFT_ANYINSTANCE or DIDFT_AXIS or DIDFT_OPTIONAL:.dwFlags=DIDOI_ASPECTACCEL:End With
|
---|
710 | With p[&H9B]:.pguid=VarPtr(GUID_Slider):.dwOfs=&H1C:.dwType=DIDFT_ANYINSTANCE or DIDFT_AXIS or DIDFT_OPTIONAL:.dwFlags=DIDOI_ASPECTACCEL:End With
|
---|
711 |
|
---|
712 | With p[&H9C]:.pguid=VarPtr(GUID_XAxis):.dwOfs=&HF0:.dwType=DIDFT_ANYINSTANCE or DIDFT_AXIS or DIDFT_OPTIONAL:.dwFlags=DIDOI_ASPECTFORCE:End With
|
---|
713 | With p[&H9D]:.pguid=VarPtr(GUID_YAxis):.dwOfs=&HF4:.dwType=DIDFT_ANYINSTANCE or DIDFT_AXIS or DIDFT_OPTIONAL:.dwFlags=DIDOI_ASPECTFORCE:End With
|
---|
714 | With p[&H9E]:.pguid=VarPtr(GUID_ZAxis):.dwOfs=&HF8:.dwType=DIDFT_ANYINSTANCE or DIDFT_AXIS or DIDFT_OPTIONAL:.dwFlags=DIDOI_ASPECTFORCE:End With
|
---|
715 | With p[&H9F]:.pguid=VarPtr(GUID_RxAxis):.dwOfs=&HFC:.dwType=DIDFT_ANYINSTANCE or DIDFT_AXIS or DIDFT_OPTIONAL:.dwFlags=DIDOI_ASPECTFORCE:End With
|
---|
716 | With p[&HA0]:.pguid=VarPtr(GUID_RyAxis):.dwOfs=&H100:.dwType=DIDFT_ANYINSTANCE or DIDFT_AXIS or DIDFT_OPTIONAL:.dwFlags=DIDOI_ASPECTFORCE:End With
|
---|
717 | With p[&HA1]:.pguid=VarPtr(GUID_RzAxis):.dwOfs=&H104:.dwType=DIDFT_ANYINSTANCE or DIDFT_AXIS or DIDFT_OPTIONAL:.dwFlags=DIDOI_ASPECTFORCE:End With
|
---|
718 | With p[&HA2]:.pguid=VarPtr(GUID_Slider):.dwOfs=&H18:.dwType=DIDFT_ANYINSTANCE or DIDFT_AXIS or DIDFT_OPTIONAL:.dwFlags=DIDOI_ASPECTFORCE:End With
|
---|
719 | With p[&HA3]:.pguid=VarPtr(GUID_Slider):.dwOfs=&H1C:.dwType=DIDFT_ANYINSTANCE or DIDFT_AXIS or DIDFT_OPTIONAL:.dwFlags=DIDOI_ASPECTFORCE:End With
|
---|
720 | End Sub
|
---|
721 | Dim _System_dfDIJoystick2ObjectDataFormat[&HA3]=[
|
---|
722 | [0,&H00,DIDFT_ANYINSTANCE or DIDFT_AXIS or DIDFT_OPTIONAL,DIDOI_ASPECTPOSITION],
|
---|
723 | [0,&H04,DIDFT_ANYINSTANCE or DIDFT_AXIS or DIDFT_OPTIONAL,DIDOI_ASPECTPOSITION],
|
---|
724 | [0,&H08,DIDFT_ANYINSTANCE or DIDFT_AXIS or DIDFT_OPTIONAL,DIDOI_ASPECTPOSITION],
|
---|
725 | [0,&H0C,DIDFT_ANYINSTANCE or DIDFT_AXIS or DIDFT_OPTIONAL,DIDOI_ASPECTPOSITION],
|
---|
726 | [0,&H10,DIDFT_ANYINSTANCE or DIDFT_AXIS or DIDFT_OPTIONAL,DIDOI_ASPECTPOSITION],
|
---|
727 | [0,&H14,DIDFT_ANYINSTANCE or DIDFT_AXIS or DIDFT_OPTIONAL,DIDOI_ASPECTPOSITION],
|
---|
728 | [0,&H18,DIDFT_ANYINSTANCE or DIDFT_AXIS or DIDFT_OPTIONAL,DIDOI_ASPECTPOSITION],
|
---|
729 | [0,&H1C,DIDFT_ANYINSTANCE or DIDFT_AXIS or DIDFT_OPTIONAL,DIDOI_ASPECTPOSITION],
|
---|
730 | [0,&H20,DIDFT_ANYINSTANCE or DIDFT_POV or DIDFT_OPTIONAL,0],
|
---|
731 | [0,&H24,DIDFT_ANYINSTANCE or DIDFT_POV or DIDFT_OPTIONAL,0],
|
---|
732 | [0,&H28,DIDFT_ANYINSTANCE or DIDFT_POV or DIDFT_OPTIONAL,0],
|
---|
733 | [0,&H2C,DIDFT_ANYINSTANCE or DIDFT_POV or DIDFT_OPTIONAL,0]
|
---|
734 | ] As DIOBJECTDATAFORMAT
|
---|
735 | _System_dfDIJoystick2ObjectDataFormat[0].pguid=VarPtr(GUID_XAxis)
|
---|
736 | _System_dfDIJoystick2ObjectDataFormat[1].pguid=VarPtr(GUID_YAxis)
|
---|
737 | _System_dfDIJoystick2ObjectDataFormat[2].pguid=VarPtr(GUID_ZAxis)
|
---|
738 | _System_dfDIJoystick2ObjectDataFormat[3].pguid=VarPtr(GUID_RxAxis)
|
---|
739 | _System_dfDIJoystick2ObjectDataFormat[4].pguid=VarPtr(GUID_RyAxis)
|
---|
740 | _System_dfDIJoystick2ObjectDataFormat[5].pguid=VarPtr(GUID_RzAxis)
|
---|
741 | _System_dfDIJoystick2ObjectDataFormat[6].pguid=VarPtr(GUID_Slider)
|
---|
742 | _System_dfDIJoystick2ObjectDataFormat[7].pguid=VarPtr(GUID_Slider)
|
---|
743 | _System_dfDIJoystick2ObjectDataFormat[8].pguid=VarPtr(GUID_POV)
|
---|
744 | _System_dfDIJoystick2ObjectDataFormat[9].pguid=VarPtr(GUID_POV)
|
---|
745 | _System_dfDIJoystick2ObjectDataFormat[10].pguid=VarPtr(GUID_POV)
|
---|
746 | _System_dfDIJoystick2ObjectDataFormat[11].pguid=VarPtr(GUID_POV)
|
---|
747 | _System_DirectInput_Joystick2_SetDataType(_System_dfDIJoystickObjectDataFormat)
|
---|
748 | Dim c_dfDIJoystick2=[24,16,DIDF_ABSAXIS,&H110,&HA4,0] As DIDATAFORMAT
|
---|
749 | c_dfDIJoystick2.rgodf=_System_dfDIJoystick2ObjectDataFormat
|
---|
750 |
|
---|
751 |
|
---|
752 | #endif '_INC_DINPUT
|
---|