Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

9132 lines
333 KiB

  1. sinclude(`dimkhdr.m4')dnl This file must be preprocessed by the m4 preprocessor.
  2. sinclude(`../dimkhdr.m4')dnl Need both lines so we build on both 95 and NT.
  3. sinclude(`inc/dimkhdr.m4')dnl For \nt\private\windows nmake makefil0.
  4. /****************************************************************************
  5. *
  6. * Copyright (C) 1996 Microsoft Corporation. All Rights Reserved.;public_dx3
  7. * Copyright (C) 1996-1998 Microsoft Corporation. All Rights Reserved.;public_dx5
  8. * Copyright (C) 1996-1998 Microsoft Corporation. All Rights Reserved.;public_dx5b2
  9. * Copyright (C) 1996-1999 Microsoft Corporation. All Rights Reserved.;public_dx6
  10. * Copyright (C) 1996-1999 Microsoft Corporation. All Rights Reserved.;public_dx7
  11. * Copyright (C) 1996-2002 Microsoft Corporation. All Rights Reserved.;public_dx8
  12. *
  13. * File: dinput.h
  14. * Content: DirectInput include file
  15. begindoc
  16. * History:
  17. * Date By Reason
  18. * ==== == ======
  19. * 1996.05.07 raymondc Somebody had to
  20. * 1996.08.07 a-marcan added stray and new vjoyd definitions
  21. * for manbugs: 77, 2167 and 2184
  22. * 1998.01.07 omsharma Version 5B2,
  23. * 1999.01.16 marcand DX7 version (1999.02.09) -> DX6.2 -> DX6.1a
  24. *
  25. * Special markers:
  26. *
  27. * Each special marker can either be applied to a single line
  28. * (appended to the end) or spread over a range. For example
  29. * suppose that ;mumble is a marker. Then you can either say
  30. *
  31. * blah blah blah ;mumble
  32. *
  33. * to apply the marker to a single line, or
  34. *
  35. * ;begin_mumble
  36. * blah blah
  37. * blah blah
  38. * blah blah
  39. * ;end_mumble
  40. *
  41. * to apply it to a range of lines.
  42. *
  43. *
  44. * Note that the command line to hsplit.exe must look like
  45. * this for these markers to work:
  46. *
  47. * hsplit -u -ta dx# -v #00
  48. *
  49. * where the two "#"s are the version of DX that the header
  50. * file is being generated for. They had better match, too.
  51. *
  52. *
  53. * Marker: ;public_300
  54. *
  55. * Lines tagged with this marker will appear in all header files
  56. * DX3 **and later**. There should never be a ;public_300 since
  57. * 300 is the first version of the header file. Use ;public_dx3
  58. * for lines that are specific to version 300 and not to future
  59. * versions.
  60. *
  61. * Marker: ;public_500
  62. *
  63. * Lines tagged with this marker will appear in all header files
  64. * DX5 **and later**. It will not appear in the DX3 header file.
  65. *
  66. * Marker: ;public_50A
  67. *
  68. * Lines tagged with this marker will appear in all header files
  69. * DX5a **and later**. It will not appear in the DX3 or DX5
  70. * header file.
  71. *
  72. * Marker: ;public_5B2
  73. *
  74. * Lines tagged with this marker will appear in all header files
  75. * DX5b2 **and later**. It will not appear in the DX3, DX5 or
  76. * DX5a header file.
  77. *
  78. * Marker: ;public_600
  79. *
  80. * Lines tagged with this marker will appear in all header files
  81. * DX6 (aka DX6.1a) **and later**. It will not appear in the DX3,
  82. * DX5, DX5a or DX5b2 header file.
  83. *
  84. * Marker: ;public_700
  85. *
  86. * Lines tagged with this marker will appear in all header files
  87. * DX7 **and later**. It will not appear in the DX3, DX5, DX5a
  88. * DX5b2 or DX6 header file.
  89. *
  90. * Marker: ;public_800
  91. *
  92. * Lines tagged with this marker will appear in all header files
  93. * DX8 **and later**. It will not appear in the DX3, DX5, DX5a
  94. * DX5b2, DX6 or DX7 header file.
  95. *
  96. * Marker: ;public_900
  97. *
  98. * Lines tagged with this marker will appear in all header files
  99. * DX8 **and later**. It will not appear in the DX3, DX5, DX5a
  100. * DX5b2, DX6, DX7 or DX8 header file.
  101. *
  102. * Marker: ;public_dx3
  103. * Marker: ;public_dx5
  104. * Marker: ;public_dx5a
  105. * Marker: ;public_dx5b2
  106. * Marker: ;public_dx6
  107. * Marker: ;public_dx7
  108. * Marker: ;public_dx8
  109. * Marker: ;public_dx9
  110. *
  111. * Lines tagged with these markers will appear *only* in the DX3
  112. * or DX5 or DX5a or DX5b2 or DX6.1a or DX7 or DX8 or DX9 version
  113. * of the header file.
  114. *
  115. * There should never be a ;public_dx8 since DX8 is the latest
  116. * version of the header file. Use ;public_800 for lines that
  117. * are new for version 8 and apply to all future versions.
  118. *
  119. * Marker: ;if_(DIRECTINPUT_VERSION)_500
  120. *
  121. * Lines tagged with this marker will appear only in the DX5
  122. * version of the header file. Furthermore, its appearance
  123. * in the header file will be bracketed with
  124. *
  125. * #if(DIRECTINPUT_VERSION) >= 0x0500
  126. * ...
  127. * #endif
  128. *
  129. * Try to avoid using this marker, because the number _500 needs
  130. * to change as each new beta version is released. (Yuck.)
  131. *
  132. * If you choose to use this as a bracketing tag, the end
  133. * tag is ";end" and not ";end_if_(DIRECTINPUT_VERSION)_500".
  134. *
  135. enddoc
  136. *
  137. ****************************************************************************/
  138. #ifndef __DINPUT_INCLUDED__
  139. #define __DINPUT_INCLUDED__
  140. #ifndef DIJ_RINGZERO
  141. #ifdef _WIN32
  142. #define COM_NO_WINDOWS_H
  143. #include <objbase.h>
  144. #endif
  145. #endif /* DIJ_RINGZERO */
  146. #ifdef __cplusplus
  147. extern "C" {
  148. #endif
  149. ;begin_internal_dx5a
  150. /*
  151. * Note that the default DIRECTINPUT_VERSION for DX5a is still 0x0500.
  152. *
  153. * This is intentional. There are no interface changes between
  154. * DX5 and DX5a and we want code written with the DX5a header file
  155. * to work on DX5 also.
  156. */
  157. ;end_internal_dx5a
  158. ;begin_public_dx5a
  159. /*
  160. * To take advantage of HID functionality, you must do a
  161. *
  162. * #define DIRECTINPUT_VERSION 0x050A
  163. *
  164. * before #include <dinput.h>. By default, #include <dinput.h>
  165. * will produce a DirectX 5-compatible header file.
  166. *
  167. */
  168. ;end_public_dx5a
  169. ;begin_internal_dx5b2
  170. /*
  171. * Note that the default DIRECTINPUT_VERSION for DX5b2 is still 0x0500.
  172. *
  173. * This is intentional. There are no interface changes between
  174. * DX5 and DX5b2 and we want code written with the DX5b2 header file
  175. * to work on DX5 also.
  176. */
  177. ;end_internal_dx5b2
  178. ;begin_public_dx5b2
  179. /*
  180. * To take advantage of HID and WDM gameport functionality, you must do a
  181. *
  182. * #define DIRECTINPUT_VERSION 0x05B2
  183. *
  184. * before #include <dinput.h>. By default, #include <dinput.h>
  185. * will produce a DirectX 5-compatible header file.
  186. *
  187. */
  188. ;end_public_dx5b2
  189. ;begin_internal_dx6
  190. /*
  191. * Note that the default DIRECTINPUT_VERSION for DX6 is still 0x0500.
  192. *
  193. * This is intentional. There are no interface changes between
  194. * DX5 and DX6 and we want code written with the DX6 header file
  195. * to work on DX5 also.
  196. */
  197. ;end_internal_dx6
  198. ;begin_public_dx6
  199. /*
  200. * To take advantage of HID and WDM gameport functionality, you must do a
  201. *
  202. * #define DIRECTINPUT_VERSION 0x061A
  203. *
  204. * before #include <dinput.h>. By default, #include <dinput.h>
  205. * will produce a DirectX 5-compatible header file.
  206. *
  207. */
  208. ;end_public_dx6
  209. ;begin_public_dx7
  210. /*
  211. * To build applications for older versions of DirectInput
  212. *
  213. * #define DIRECTINPUT_VERSION 0x0300
  214. * or
  215. * #define DIRECTINPUT_VERSION 0x0500
  216. *
  217. * before #include <dinput.h>. By default, #include <dinput.h>
  218. * will produce a DirectX 7-compatible header file.
  219. *
  220. */
  221. ;end_public_dx7
  222. ;begin_public_800
  223. /*
  224. * To build applications for older versions of DirectInput
  225. *
  226. * #define DIRECTINPUT_VERSION [ 0x0300 | 0x0500 | 0x0700 ]
  227. *
  228. * before #include <dinput.h>. By default, #include <dinput.h>
  229. * will produce a DirectX 8-compatible header file.
  230. *
  231. */
  232. ;end_public_800
  233. #define DIRECTINPUT_HEADER_VERSION 0x0800 ;public_800
  234. #ifndef DIRECTINPUT_VERSION ;public_500
  235. #define DIRECTINPUT_VERSION 0x0300 ;public_dx3
  236. #pragma message(__FILE__ ": DIRECTINPUT_VERSION undefined. Defaulting to version 0x0300") ;public_dx3
  237. #define DIRECTINPUT_VERSION 0x0500 ;public_dx5
  238. #pragma message(__FILE__ ": DIRECTINPUT_VERSION undefined. Defaulting to version 0x0500") ;public_dx5
  239. #define DIRECTINPUT_VERSION 0x0600 ;public_dx6
  240. #pragma message(__FILE__ ": DIRECTINPUT_VERSION undefined. Defaulting to version 0x0600") ;public_dx6
  241. #define DIRECTINPUT_VERSION 0x0700 ;public_dx7
  242. #pragma message(__FILE__ ": DIRECTINPUT_VERSION undefined. Defaulting to version 0x0700") ;public_dx7
  243. #define DIRECTINPUT_VERSION DIRECTINPUT_HEADER_VERSION ;public_800
  244. #pragma message(__FILE__ ": DIRECTINPUT_VERSION undefined. Defaulting to version 0x0800") ;public_800
  245. #endif ;public_500
  246. #ifndef DIJ_RINGZERO
  247. /****************************************************************************
  248. *
  249. * Class IDs
  250. *
  251. ****************************************************************************/
  252. DEFINE_GUID(CLSID_DirectInput, 0x25E609E0,0xB259,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
  253. DEFINE_GUID(CLSID_DirectInputDevice, 0x25E609E1,0xB259,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
  254. DEFINE_GUID(CLSID_DirectInput8, 0x25E609E4,0xB259,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
  255. DEFINE_GUID(CLSID_DirectInputDevice8,0x25E609E5,0xB259,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
  256. /****************************************************************************
  257. *
  258. * Interfaces
  259. *
  260. begindoc
  261. *
  262. * We use these GUIDs for named system objects as well.
  263. *
  264. * IID_IDirectInputW -
  265. * Name of the mutex that gates access to shared memory.
  266. *
  267. * IID_IDirectInputDeviceW -
  268. * Name of the shared memory block that tracks exclusively-
  269. * acquired objects.
  270. *
  271. enddoc
  272. ****************************************************************************/
  273. DEFINE_GUID(IID_IDirectInputA, 0x89521360,0xAA8A,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
  274. DEFINE_GUID(IID_IDirectInputW, 0x89521361,0xAA8A,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
  275. DEFINE_GUID(IID_IDirectInput2A, 0x5944E662,0xAA8A,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
  276. DEFINE_GUID(IID_IDirectInput2W, 0x5944E663,0xAA8A,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
  277. DEFINE_GUID(IID_IDirectInput7A, 0x9A4CB684,0x236D,0x11D3,0x8E,0x9D,0x00,0xC0,0x4F,0x68,0x44,0xAE);
  278. DEFINE_GUID(IID_IDirectInput7W, 0x9A4CB685,0x236D,0x11D3,0x8E,0x9D,0x00,0xC0,0x4F,0x68,0x44,0xAE);
  279. DEFINE_GUID(IID_IDirectInput8A, 0xBF798030,0x483A,0x4DA2,0xAA,0x99,0x5D,0x64,0xED,0x36,0x97,0x00);
  280. DEFINE_GUID(IID_IDirectInput8W, 0xBF798031,0x483A,0x4DA2,0xAA,0x99,0x5D,0x64,0xED,0x36,0x97,0x00);
  281. DEFINE_GUID(IID_IDirectInputDeviceA, 0x5944E680,0xC92E,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
  282. DEFINE_GUID(IID_IDirectInputDeviceW, 0x5944E681,0xC92E,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
  283. DEFINE_GUID(IID_IDirectInputDevice2A,0x5944E682,0xC92E,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
  284. DEFINE_GUID(IID_IDirectInputDevice2W,0x5944E683,0xC92E,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
  285. DEFINE_GUID(IID_IDirectInputDevice7A,0x57D7C6BC,0x2356,0x11D3,0x8E,0x9D,0x00,0xC0,0x4F,0x68,0x44,0xAE);
  286. DEFINE_GUID(IID_IDirectInputDevice7W,0x57D7C6BD,0x2356,0x11D3,0x8E,0x9D,0x00,0xC0,0x4F,0x68,0x44,0xAE);
  287. DEFINE_GUID(IID_IDirectInputDevice8A,0x54D41080,0xDC15,0x4833,0xA4,0x1B,0x74,0x8F,0x73,0xA3,0x81,0x79);
  288. DEFINE_GUID(IID_IDirectInputDevice8W,0x54D41081,0xDC15,0x4833,0xA4,0x1B,0x74,0x8F,0x73,0xA3,0x81,0x79);
  289. DEFINE_GUID(IID_IDirectInputEffect, 0xE7E1F7C0,0x88D2,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35);
  290. //GUID_FILEEFFECT is used to establish a effect file version;internal
  291. //beta file format different from final, so have different GUID;internal
  292. DEFINE_GUID(GUID_INTERNALFILEEFFECTBETA,0X981DC402, 0X880, 0X11D3, 0X8F, 0XB2, 0X0, 0XC0, 0X4F, 0X8E, 0XC6, 0X27);;internal
  293. //final for DX7 {197E775C-34BA-11d3-ABD5-00C04F8EC627};internal
  294. DEFINE_GUID(GUID_INTERNALFILEEFFECT, 0x197e775c, 0x34ba, 0x11d3, 0xab, 0xd5, 0x0, 0xc0, 0x4f, 0x8e, 0xc6, 0x27);;internal
  295. /****************************************************************************
  296. *
  297. * Predefined object types
  298. *
  299. ****************************************************************************/
  300. DEFINE_GUID(GUID_XAxis, 0xA36D02E0,0xC9F3,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
  301. DEFINE_GUID(GUID_YAxis, 0xA36D02E1,0xC9F3,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
  302. DEFINE_GUID(GUID_ZAxis, 0xA36D02E2,0xC9F3,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
  303. DEFINE_GUID(GUID_RxAxis, 0xA36D02F4,0xC9F3,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
  304. DEFINE_GUID(GUID_RyAxis, 0xA36D02F5,0xC9F3,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
  305. DEFINE_GUID(GUID_RzAxis, 0xA36D02E3,0xC9F3,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
  306. DEFINE_GUID(GUID_Slider, 0xA36D02E4,0xC9F3,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
  307. ;begin_internal
  308. #if DIRECTINPUT_VERSION <= 0x0300
  309. /*
  310. * Old GUIDs from DX3 that were never used but which we can't recycle
  311. * because we shipped them.
  312. */
  313. DEFINE_GUID(GUID_RAxis, 0xA36D02E3,0xC9F3,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
  314. DEFINE_GUID(GUID_UAxis, 0xA36D02E4,0xC9F3,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
  315. DEFINE_GUID(GUID_VAxis, 0xA36D02E5,0xC9F3,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
  316. #endif
  317. ;end_internal
  318. DEFINE_GUID(GUID_Button, 0xA36D02F0,0xC9F3,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
  319. DEFINE_GUID(GUID_Key, 0x55728220,0xD33C,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
  320. DEFINE_GUID(GUID_POV, 0xA36D02F2,0xC9F3,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
  321. DEFINE_GUID(GUID_Unknown, 0xA36D02F3,0xC9F3,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
  322. /****************************************************************************
  323. *
  324. * Predefined product GUIDs
  325. *
  326. ****************************************************************************/
  327. begindoc
  328. /****************************************************************************
  329. *
  330. * @doc EXTERNAL
  331. *
  332. * @global GUID | GUID_SysMouse |
  333. *
  334. * A pre-defined DirectInput instance GUID that always refers to the
  335. * default system mouse.
  336. *
  337. * @global GUID | GUID_SysMouseEm |
  338. *
  339. * A pre-defined DirectInput instance GUID that always refers to the
  340. * default system mouse via emulation level 1.
  341. * Since this is an alias for the <c GUID_SysMouse>, it is not
  342. * enumerated by <mf IDirectInput::EnumDevices> unless the
  343. * <c DIEDFL_INCLUDEALIASES> flag is passed.
  344. *
  345. * Passing this GUID to <mf IDirectInput::CreateDevice> grants
  346. * access to the system mouse through an emulation layer.
  347. * Applications are not expected to use this GUID in normal
  348. * gameplay; it exists primarily for testing.
  349. *
  350. * This instance GUID is new for DirectX 5.0a.
  351. *
  352. * @global GUID | GUID_SysMouseEm2 |
  353. *
  354. * A pre-defined DirectInput instance GUID that always refers to the
  355. * default system keyboard via emulation level 2.
  356. * Since this is an alias for the <c GUID_SysMouse>, it is not
  357. * enumerated by <mf IDirectInput::EnumDevices> unless the
  358. * <c DIEDFL_INCLUDEALIASES> flag is passed.
  359. *
  360. * Passing this GUID to <mf IDirectInput::CreateDevice> grants
  361. * access to the system mouse through an emulation layer.
  362. * Applications are not expected to use this GUID in normal
  363. * gameplay; it exists primarily for testing.
  364. *
  365. * This instance GUID is new for DirectX 5.0a.
  366. *
  367. * @global GUID | GUID_SysKeyboard |
  368. *
  369. * A pre-defined DirectInput instance GUID that always refers to the
  370. * default system keyboard.
  371. *
  372. * @global GUID | GUID_SysKeyboardEm |
  373. *
  374. * A pre-defined DirectInput instance GUID that always refers to the
  375. * default system keyboard via emulation level 1.
  376. * Since this is an alias for the <c GUID_SysKeyboard>, it is not
  377. * enumerated by <mf IDirectInput::EnumDevices> unless the
  378. * <c DIEDFL_INCLUDEALIASES> flag is passed.
  379. *
  380. * Passing this GUID to <mf IDirectInput::CreateDevice> grants
  381. * access to the system keyboard through an emulation layer.
  382. * Applications are not expected to use this GUID in normal
  383. * gameplay; it exists primarily for testing.
  384. *
  385. * This instance GUID is new for DirectX 5.0a.
  386. *
  387. * @global GUID | GUID_SysKeyboardEm2 |
  388. *
  389. * A pre-defined DirectInput instance GUID that always refers to the
  390. * default system keyboard via emulation level 2.
  391. * Since this is an alias for the <c GUID_SysKeyboard>, it is not
  392. * enumerated by <mf IDirectInput::EnumDevices> unless the
  393. * <c DIEDFL_INCLUDEALIASES> flag is passed.
  394. *
  395. * Passing this GUID to <mf IDirectInput::CreateDevice> grants
  396. * access to the system keyboard through an emulation layer.
  397. * Applications are not expected to use this GUID in normal
  398. * gameplay; it exists primarily for testing.
  399. *
  400. * This instance GUID is new for DirectX 5.0a.
  401. *
  402. * @global GUID | GUID_Joystick |
  403. *
  404. * A pre-defined DirectInput product (not instance)
  405. * GUID that always refers to standard joysticks.
  406. *
  407. * There are no predefined GUIDs for joystick instances.
  408. * Applications should use <mf IDirectInput::EnumDevices>
  409. * to identify joysticks.
  410. *
  411. ****************************************************************************/
  412. enddoc
  413. DEFINE_GUID(GUID_SysMouse, 0x6F1D2B60,0xD5A0,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
  414. DEFINE_GUID(GUID_SysKeyboard,0x6F1D2B61,0xD5A0,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
  415. DEFINE_GUID(GUID_Joystick ,0x6F1D2B70,0xD5A0,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);;public_500
  416. DEFINE_GUID(GUID_SysMouseEm, 0x6F1D2B80,0xD5A0,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);;public_50a
  417. DEFINE_GUID(GUID_SysMouseEm2,0x6F1D2B81,0xD5A0,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);;public_50a
  418. DEFINE_GUID(GUID_SysKeyboardEm, 0x6F1D2B82,0xD5A0,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);;public_50a
  419. DEFINE_GUID(GUID_SysKeyboardEm2,0x6F1D2B83,0xD5A0,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);;public_50a
  420. ;begin_public_500
  421. /****************************************************************************
  422. *
  423. * Predefined force feedback effects
  424. *
  425. ****************************************************************************/
  426. DEFINE_GUID(GUID_ConstantForce, 0x13541C20,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35);
  427. DEFINE_GUID(GUID_RampForce, 0x13541C21,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35);
  428. DEFINE_GUID(GUID_Square, 0x13541C22,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35);
  429. DEFINE_GUID(GUID_Sine, 0x13541C23,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35);
  430. DEFINE_GUID(GUID_Triangle, 0x13541C24,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35);
  431. DEFINE_GUID(GUID_SawtoothUp, 0x13541C25,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35);
  432. DEFINE_GUID(GUID_SawtoothDown, 0x13541C26,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35);
  433. DEFINE_GUID(GUID_Spring, 0x13541C27,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35);
  434. DEFINE_GUID(GUID_Damper, 0x13541C28,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35);
  435. DEFINE_GUID(GUID_Inertia, 0x13541C29,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35);
  436. DEFINE_GUID(GUID_Friction, 0x13541C2A,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35);
  437. DEFINE_GUID(GUID_CustomForce, 0x13541C2B,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35);
  438. ;end_public_500
  439. ;begin_public_900
  440. DEFINE_GUID(GUID_RandomForce, 0x13541C2C,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35);
  441. DEFINE_GUID(GUID_MoveToPosition,0x13541C2D,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35);
  442. DEFINE_GUID(GUID_MoveToVelocity,0x13541C2E,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35);
  443. DEFINE_GUID(GUID_SoloBump, 0x13541C2F,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35);
  444. DEFINE_GUID(GUID_MultipleBump, 0x13541C30,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35);
  445. DEFINE_GUID(GUID_InfiniteBump, 0x13541C31,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35);
  446. ;end_public_900
  447. #endif /* DIJ_RINGZERO */
  448. /****************************************************************************
  449. *
  450. * Interfaces and Structures...
  451. *
  452. ****************************************************************************/
  453. ;begin_if_(DIRECTINPUT_VERSION)_500
  454. /****************************************************************************
  455. *
  456. * IDirectInputEffect
  457. *
  458. ****************************************************************************/
  459. begindoc
  460. /****************************************************************************
  461. *
  462. * @doc EXTERNAL
  463. *
  464. * @flags DirectInput Effect Format Types |
  465. *
  466. * Describe attributes of a single effect on a device.
  467. *
  468. * The low byte of the effect format type represents
  469. * the type of the effect. Higher-order bits represents
  470. * capability flags.
  471. *
  472. * @flag DIEFT_ALL |
  473. *
  474. * Valid only for <mf IDirectInputDevice2::EnumEffects>:
  475. * Enumerate all effects,
  476. * regardless of type. This flag may not be combined
  477. * with any of the other flags.
  478. *
  479. * @flag DIEFT_CONSTANTFORCE |
  480. *
  481. * The effect represents a constant-force effect.
  482. * When creating or modifying a constant-force effect,
  483. * the <e DIEFFECT.lpvTypeSpecificParams> field
  484. * of the <t DIEFFECT> must point to a <t DICONSTANTFORCE>
  485. * structure and the
  486. * <e DIEFFECT.cbTypeSpecificParams> field must
  487. * be set to
  488. * sizeof(<t DICONSTANTFORCE>).
  489. *
  490. * The flag can be passed to <mf IDirectInputDevice2::EnumEffects>
  491. * to restrict the enumeration to constant-force effects.
  492. *
  493. * @flag DIEFT_RAMPFORCE |
  494. *
  495. * The effect represents a ramp-force effect.
  496. * When creating or modifying a ramp-force effect,
  497. * the <e DIEFFECT.lpvTypeSpecificParams> field
  498. * of the <t DIEFFECT> must point to a <t DIRAMPFORCE>
  499. * structure and the
  500. * <e DIEFFECT.cbTypeSpecificParams> field must
  501. * be set to
  502. * sizeof(<t DIRAMPFORCE>).
  503. *
  504. * The flag can be passed to <mf IDirectInputDevice2::EnumEffects>
  505. * to restrict the enumeration to ramp-force effects.
  506. *
  507. * @flag DIEFT_PERIODIC |
  508. *
  509. * The effect represents a periodic effect.
  510. * When creating or modifying a periodic effect,
  511. * the <e DIEFFECT.lpvTypeSpecificParams> field
  512. * of the <t DIEFFECT> must point to a <t DIPERIODIC>
  513. * structure and the
  514. * <e DIEFFECT.cbTypeSpecificParams> field must
  515. * be set to
  516. * sizeof(<t DIPERIODIC>).
  517. *
  518. * The flag can be passed to <mf IDirectInputDevice2::EnumEffects>
  519. * to restrict the enumeration to periodic effects.
  520. *
  521. * @flag DIEFT_CONDITION |
  522. *
  523. * The effect represents a condition.
  524. * When creating or modifying a condition,
  525. * the <e DIEFFECT.lpvTypeSpecificParams> field
  526. * of the <t DIEFFECT> must point to an array of
  527. * <t DICONDITION> structure (one per axis) and the
  528. * <e DIEFFECT.cbTypeSpecificParams> field must
  529. * be set to
  530. * cAxis * sizeof(<t DICONDITION>).
  531. *
  532. * Note that not all devices support all the parameters
  533. * of conditions. Check the effect capability flags
  534. * (listed below)
  535. * to determine which capabilities are available.
  536. *
  537. * The flag can be passed to <mf IDirectInputDevice2::EnumEffects>
  538. * to restrict the enumeration to conditions.
  539. *
  540. * @flag DIEFT_CUSTOMFORCE |
  541. *
  542. * The effect represents a custom-force effect.
  543. * When creating or modifying a custom-force effect,
  544. * the <e DIEFFECT.lpvTypeSpecificParams> field
  545. * of the <t DIEFFECT> must point to a <t DICUSTOMFORCE>
  546. * structure and the
  547. * <e DIEFFECT.cbTypeSpecificParams> field must
  548. * be set to
  549. * sizeof(<t DICUSTOMFORCE>).
  550. *
  551. * The flag can be passed to <mf IDirectInputDevice2::EnumEffects>
  552. * to restrict the enumeration to custom-force effects.
  553. *
  554. ;begin_public_900
  555. * @flag DIEFT_BARRIERFORCE |
  556. *
  557. * The effect represents a barrier force effect.
  558. * When creating or modifying a barrier force effect,
  559. * the <e DIEFFECT.lpvTypeSpecificParams> field
  560. * of the <t DIEFFECT> must point to an array of
  561. * <t DIBARRIERFORCE> structures (one per axis) and the
  562. * <e DIEFFECT.cbTypeSpecificParams> field must
  563. * be set to cAxis * sizeof(<t DIBARRIERFORCE>).
  564. *
  565. * The flag can be passed to <mf IDirectInputDevice2::EnumEffects>
  566. * to restrict the enumeration to barrier force effects.
  567. *
  568. ;end_public_900
  569. * @flag DIEFT_HARDWARE |
  570. *
  571. * The effect represents a hardware-specific effect.
  572. * For additional information on using a hardware-specific
  573. * effect, consult the hardware documentation.
  574. *
  575. * The flag can be passed to <mf IDirectInputDevice2::EnumEffects>
  576. * to restrict the enumeration to hardware-specific effects.
  577. *
  578. * @flag DIEFT_FFATTACK |
  579. *
  580. * The effect generator for this effect supports
  581. * the attack envelope parameter. If the effect generator
  582. * does not support attack then the
  583. * attack level and attack time parameters of
  584. * the <t DIENVELOPE> structure will be ignored by the effect.
  585. *
  586. * @flag DIEFT_FFFADE |
  587. *
  588. * The effect generator for this effect supports
  589. * the fade parameter. If the effect generator
  590. * does not support fade then the
  591. * fade level and fade time parameters of
  592. * the <t DIENVELOPE> structure will be ignored by the effect.
  593. *
  594. * If neither <c DIEFT_FFATTACK> nor
  595. * <c DIEFT_FFFADE> is set, then the effect does not
  596. * support an envelope, and any provided envelope
  597. * will be ignored.
  598. *
  599. * @flag DIEFT_SATURATION |
  600. *
  601. * The effect generator for this effect supports
  602. * the saturation of condition effects.
  603. * If the effect generator does not support
  604. * saturation, then the force generated by a condition
  605. * is limited only by the maximum force which the device
  606. * can generate.
  607. *
  608. * @flag DIEFT_POSNEGCOEFFICIENTS |
  609. *
  610. * The effect generator for this effect supports
  611. * two coefficient values for conditions, one
  612. * for the positive displacement of the axis and one for
  613. * the negative displacement of the axis. If the device
  614. * does not support both coefficients, then the negative
  615. * coefficient in the <t DICONDITION> structure will be ignored
  616. * and the positive coefficient will be used in both directions.
  617. *
  618. * @flag DIEFT_POSNEGSATURATION |
  619. *
  620. * The effect generator for this effect supports
  621. * a maximum saturation for both positive and
  622. * negative force output. If the device does not support
  623. * both saturation values, then the negative saturation
  624. * in the <t DICONDITON> structure will be ignored
  625. * and the positive saturation will be used in both directions.
  626. *
  627. * @flag DIEFT_DEADBAND |
  628. *
  629. * The effect generator for this effect supports
  630. * the <e DICONDITION.lDeadBand> parameter.
  631. * If the device does not support condition dead band
  632. * for the effect, then the dead band will be ignored.
  633. *
  634. * @flag DIEFT_STARTDELAY |
  635. *
  636. * The effect generator for this effect supports
  637. * the <e DIEFFECT.dwStartDelay> parameter.
  638. * If the device does not support start delay for the effect,
  639. * then the delay will be ignored.
  640. *
  641. * This flag is new for DirectX 6.1a
  642. *
  643. * @xref <f DIEFT_GETTYPE>.
  644. *
  645. * @func BYTE | DIEFT_GETTYPE |
  646. *
  647. * Extracts the effect type code from an effect format type.
  648. *
  649. * @parm DWORD | dwType |
  650. *
  651. * DirectInput effect format type.
  652. *
  653. * @xref "DirectInput Effect Format Types".
  654. *
  655. ****************************************************************************/
  656. /*
  657. * ISSUE-2001/03/29-timgill Need more type clarification
  658. * Which of the basic types support envelopes?
  659. * Which support duration? Which support direction?
  660. *
  661. */
  662. enddoc
  663. #define DIEFT_ALL 0x00000000
  664. #define DIEFT_PREDEFMIN 0x00000001;internal
  665. #define DIEFT_CONSTANTFORCE 0x00000001
  666. #define DIEFT_RAMPFORCE 0x00000002
  667. #define DIEFT_PERIODIC 0x00000003
  668. #define DIEFT_CONDITION 0x00000004
  669. #define DIEFT_CUSTOMFORCE 0x00000005
  670. #define DIEFT_BARRIERFORCE 0x00000006;public_900
  671. #define DIEFT_PREDEFMAX 0x00000005;internal_dx5
  672. #define DIEFT_PREDEFMAX 0x00000005;internal_dx5a
  673. #define DIEFT_PREDEFMAX 0x00000005;internal_dx5b2
  674. #define DIEFT_PREDEFMAX 0x00000005;internal_dx6
  675. #define DIEFT_PREDEFMAX 0x00000005;internal_dx7
  676. #define DIEFT_PREDEFMAX 0x00000005;internal_dx8
  677. //#define DIEFT_PREDEFMAX 0x00000006;internal
  678. #define DIEFT_HARDWARE 0x000000FF
  679. #define DIEFT_TYPEMASK 0x000000FF;internal
  680. #define DIEFT_FORCEFEEDBACK 0x00000100;internal
  681. #define DIEFT_FFATTACK 0x00000200
  682. #define DIEFT_FFFADE 0x00000400
  683. #define DIEFT_SATURATION 0x00000800
  684. #define DIEFT_POSNEGCOEFFICIENTS 0x00001000
  685. #define DIEFT_POSNEGSATURATION 0x00002000
  686. #define DIEFT_DEADBAND 0x00004000
  687. #define DIEFT_STARTDELAY 0x00008000;public_600
  688. #define DIEFT_VALIDFLAGS 0x00007E00;internal_dx3
  689. #define DIEFT_VALIDFLAGS 0x00007E00;internal_dx5
  690. #define DIEFT_VALIDFLAGS 0x00007E00;internal_dx5b2
  691. #define DIEFT_VALIDFLAGS 0x0000FE00;internal_600
  692. #define DIEFT_GETTYPE(n) LOBYTE(n)
  693. #define DIEFT_ENUMVALID 0x040000FF;internal_500
  694. begindoc
  695. /****************************************************************************
  696. *
  697. * @doc EXTERNAL
  698. *
  699. * @define DI_DEGREES | 100 |
  700. *
  701. * Number of DirectInput units per degree. The naming
  702. * of the symbol is to permit the use of expressions
  703. * like "90 * <c DI_DEGREES>" to mean "90 degrees, in
  704. * DirectInput units".
  705. *
  706. * @define DI_FFNOMINALMAX | 10000 |
  707. *
  708. * Maximum value for DirectInput force and gain values.
  709. *
  710. * For example, to set a force to half of the maximum
  711. * value, use <c DI_FFNOMINAL>/2.
  712. *
  713. * @define DI_SECONDS | 1000000 |
  714. *
  715. * Number of DirectInput units (microseconds) per second.
  716. * The naming
  717. * of the symbol is to permit the use of expressions
  718. * like "2 * <c DI_SECONDS>" to mean "2 seconds, in
  719. * DirectInput units".
  720. *
  721. ****************************************************************************/
  722. enddoc
  723. #define DI_DEGREES 100
  724. #define DI_FFNOMINALMAX 10000
  725. #define DI_SECONDS 1000000
  726. begindoc
  727. /****************************************************************************
  728. *
  729. * @doc EXTERNAL
  730. *
  731. * @struct DICONSTANTFORCE |
  732. *
  733. * The <t DICONSTANTFORCE> structure contains
  734. * type-specific information for effects
  735. * which are marked as <c DIEFT_CONSTANTFORCE>.
  736. *
  737. * The structure describes a constant force effect.
  738. *
  739. * A pointer to a single <t DICONSTANTFORCE> structure
  740. * for an effect is passed in the
  741. * <e DIEFFECT.lpConstantForce> field of the
  742. * <t DIEFFECT> structure.
  743. *
  744. * @field LONG | lMagnitude |
  745. *
  746. * The magnitude of the effect, in the range -10,0000 to +10,000.
  747. * If an envelope is
  748. * applied to this effect, then the value represents
  749. * the magnitude of the sustain. If no envelope is
  750. * applied, then the value represents the amplitude
  751. * of the entire effect.
  752. *
  753. ****************************************************************************/
  754. enddoc
  755. typedef struct DICONSTANTFORCE {
  756. LONG lMagnitude;
  757. } DICONSTANTFORCE, *LPDICONSTANTFORCE;
  758. typedef const DICONSTANTFORCE *LPCDICONSTANTFORCE;
  759. begindoc
  760. /****************************************************************************
  761. *
  762. * @doc EXTERNAL
  763. *
  764. * @struct DIRAMPFORCE |
  765. *
  766. * The <t DIRAMPFORCE> structure contains
  767. * type-specific information for effects
  768. * which are marked as <c DIEFT_RAMPFORCE>.
  769. *
  770. * The structure describes a ramp force effect.
  771. *
  772. * A pointer to a single <t DIRAMPFORCE> structure
  773. * for an effect is passed in the
  774. * <e DIEFFECT.lpRampForce> field of the
  775. * <t DIEFFECT> structure.
  776. *
  777. * Note that the <e DIEFFECT.dwDuration> for a
  778. * ramp force effect cannot be <c INFINITE>.
  779. *
  780. * @field LONG | lStart |
  781. *
  782. * The magnitude at the start of the effect, in the range
  783. * -10000 to +10000.
  784. *
  785. * @field LONG | lEnd |
  786. *
  787. * The magnitude at the end of the effect, in the range
  788. * -10000 to +10000.
  789. *
  790. ****************************************************************************/
  791. enddoc
  792. typedef struct DIRAMPFORCE {
  793. LONG lStart;
  794. LONG lEnd;
  795. } DIRAMPFORCE, *LPDIRAMPFORCE;
  796. typedef const DIRAMPFORCE *LPCDIRAMPFORCE;
  797. begindoc
  798. /****************************************************************************
  799. *
  800. * @doc EXTERNAL
  801. *
  802. * @struct DIPERIODIC |
  803. *
  804. * The <t DIPERIODIC> structure contains
  805. * type-specific information for effects
  806. * which are marked as <c DIEFT_PERIODIC>.
  807. *
  808. * The structure describes a periodic effect.
  809. *
  810. * A pointer to a single <t DIPERIODIC> structure
  811. * for an effect is passed in the
  812. * <e DIEFFECT.lpPeriodic> field of the
  813. * <t DIEFFECT> structure.
  814. *
  815. * @field DWORD | dwMagnitude |
  816. *
  817. * The magnitude of the effect, in the range 0 to 10,000.
  818. * If an envelope is
  819. * applied to this effect, then the value represents
  820. * the magnitude of the sustain. If no envelope is
  821. * applied, then the value represents the amplitude
  822. * of the entire effect.
  823. *
  824. * @field LONG | lOffset |
  825. *
  826. * The offset of the effect. The range of forces
  827. * generated by the effect will be
  828. * <e DIPERIODIC.lOffset>-<e DIPERIODIC.dwMagnitude>
  829. * to
  830. * <e DIPERIODIC.lOffset>+<e DIPERIODIC.dwMagnitude>.
  831. *
  832. * The value of the <e DIPERIODIC.lOffset> field is
  833. * also the baseline for any envelope that is applied
  834. * to the effect.
  835. *
  836. * @field DWORD | dwPhase |
  837. *
  838. * The position in the periodic effect at which
  839. * playback begins, in the range 0 to 35999.
  840. *
  841. * @field DWORD | dwPeriod |
  842. *
  843. * The period of the effect in microseconds.
  844. *
  845. ****************************************************************************/
  846. enddoc
  847. typedef struct DIPERIODIC {
  848. DWORD dwMagnitude;
  849. LONG lOffset;
  850. DWORD dwPhase;
  851. DWORD dwPeriod;
  852. } DIPERIODIC, *LPDIPERIODIC;
  853. typedef const DIPERIODIC *LPCDIPERIODIC;
  854. begindoc
  855. /****************************************************************************
  856. *
  857. * @doc EXTERNAL
  858. *
  859. * @struct DICONDITION |
  860. *
  861. * The <t DICONDITION> structure contains
  862. * type-specific information for effects
  863. * which are marked as <c DIEFT_CONDITION>.
  864. *
  865. * A pointer to an array of <t DICONDITION> structures
  866. * for an effect is passed in the
  867. * <e DIEFFECT.lpCondition> field of the
  868. * <t DIEFFECT> structure. The number of
  869. * elenents in the array must be equal to
  870. * the number of axes associated with the
  871. * effect.
  872. *
  873. * @field LONG | lOffest |
  874. *
  875. * The offset for the condition, in the range
  876. * -10000 to +10000.
  877. *
  878. * Each condition interprets the offset differently;
  879. * see the comments below for additional information.
  880. *
  881. * @field LONG | lPositiveCoefficient |
  882. *
  883. * The coefficient constant on the positive
  884. * side of the offset, in the range
  885. * -10000 to +10000.
  886. *
  887. * @field LONG | lNegativeCoefficient |
  888. *
  889. * The coefficient constant on the negative
  890. * side of the offset, in the range
  891. * -10000 to +10000.
  892. *
  893. * If the device does not support separate
  894. * positive and negative coefficients, then
  895. * the value of <e DICONDITION.lNegativeCoefficient>
  896. * is ignored and
  897. * the value of <e DICONDITION.lPositiveCoefficient>
  898. * is used as both the positive and negative
  899. * coefficients.
  900. *
  901. * @field DWORD | dwPositiveSaturation |
  902. *
  903. * The maximum force output on the positive side
  904. * of the offset, in the range
  905. * 0 to 10000.
  906. *
  907. * If the device does not support force saturations,
  908. * then the value of this field is ignored.
  909. *
  910. * @field LONG | lNegativeSaturation |
  911. *
  912. * The maximum force output on the negative side
  913. * of the offset, in the range
  914. * 0 to 10000.
  915. *
  916. * If the device does not support force saturations,
  917. * then the value of this field is ignored.
  918. *
  919. * If the device does not support separate
  920. * positive and negative Saturations, then
  921. * the value of <e DICONDITION.lNegativeSaturation>
  922. * is ignored and
  923. * the value of <e DICONDITION.lPositiveSaturation>
  924. * is used as both the positive and negative
  925. * saturations.
  926. *
  927. * @field LONG | lDeadBand |
  928. *
  929. * The region around <e DICONDITION.lOffset>
  930. * where the condition is not active, in the
  931. * range 0 to 10000.
  932. * In other words, the condition is not active
  933. * between
  934. * <e DICONDITION.lOffset>-<e DICONDITION.lDeadBand>
  935. * and
  936. * <e DICONDITION.lOffset>+<e DICONDITION.lDeadBand>.
  937. *
  938. * @comm
  939. *
  940. * Different types of conditions will interpret the
  941. * parameters differently, but the basic idea is
  942. * that force resulting from a condition is equal
  943. * to A(q - q0) where A is a scaling coefficient,
  944. * q is some metric, and q0 is the neutral value
  945. * for that metric.
  946. *
  947. * The simplified formula give above must be adjusted
  948. * if a nonzero dead band is provided. If the metric
  949. * is less than
  950. * <e DICONDITION.lOffset>-<e DICONDITION.lDeadBand>,
  951. * then the
  952. * resulting force is given by the formula
  953. *
  954. * force = <e DICONDITION.lNegativeCoefficient> * (q -
  955. * (<e DICONDITION.lOffset>-<e DICONDITION.lDeadBand>))
  956. *
  957. * Similarly, if the metric is greater than
  958. * <e DICONDITION.lOffset>+<e DICONDITION.lDeadBand>,
  959. * then the
  960. * resulting force is given by the formula
  961. *
  962. * force = <e DICONDITION.lPositiveCoefficient> * (q -
  963. * (<e DICONDITION.lOffset>+<e DICONDITION.lDeadBand>))
  964. *
  965. * A spring condition uses axis position as the metric.
  966. *
  967. * A damper condition uses axis velocity as the metric.
  968. * ISSUE-2001/03/29-timgill Need to specify units for velocity
  969. *
  970. * An inertia condition uses axis acceleration as the metric.
  971. * ISSUE-2001/03/29-timgill Need to specify units for acceleration
  972. *
  973. ****************************************************************************/
  974. enddoc
  975. typedef struct DICONDITION {
  976. LONG lOffset;
  977. LONG lPositiveCoefficient;
  978. LONG lNegativeCoefficient;
  979. DWORD dwPositiveSaturation;
  980. DWORD dwNegativeSaturation;
  981. LONG lDeadBand;
  982. } DICONDITION, *LPDICONDITION;
  983. typedef const DICONDITION *LPCDICONDITION;
  984. begindoc
  985. /****************************************************************************
  986. *
  987. * @doc EXTERNAL
  988. *
  989. * @struct DICUSTOMFORCE |
  990. *
  991. * The <t DICUSTOMFORCE> structure contains
  992. * type-specific information for effects
  993. * which are marked as <c DIEFT_CUSTOMFORCE>.
  994. *
  995. * The structure describes a custom or user-defined
  996. * force.
  997. *
  998. * A pointer to a <t DICUSTOMFORCE> structure
  999. * for an effect is passed in the
  1000. * <e DIEFFECT.lpCustomForce> field of the
  1001. * <t DIEFFECT> structure.
  1002. *
  1003. * @field DWORD | cChannels |
  1004. *
  1005. * The number of channels (axes) affected
  1006. * by this force.
  1007. *
  1008. * The first channel is applied to the first axis
  1009. * associated with the effect, the second to the
  1010. * second, and so on. If there are fewer channels
  1011. * than axes, then nothing is associated with the
  1012. * extra axes.
  1013. *
  1014. * If there is but a single channel, then
  1015. * the effect will be rotated in the direction
  1016. * specified by the
  1017. * <e DIEFFECT.rglDirection> field of the
  1018. * <t DIEFFECT> structure.
  1019. *
  1020. * If there is more than one channel, then rotation
  1021. * is not allowed.
  1022. *
  1023. * Note that not all devices support rotation of
  1024. * custom effects.
  1025. *
  1026. * ISSUE-2001/03/29-timgill Need to enforce the rule on channels and direction.
  1027. *
  1028. * @field DWORD | dwSamplePeriod |
  1029. *
  1030. * The sample period in microseconds at which the
  1031. * effect was recorded.
  1032. *
  1033. * @field DWORD | cSample |
  1034. *
  1035. * The total number of samples in the
  1036. * <e DICUSTOMFORCE.rglForceData>. It must be an
  1037. * integral multiple of the <e DICUSTOMFORCE.cChannels>.
  1038. *
  1039. * @field LPLONG | rglForceData |
  1040. *
  1041. * A pointer to an array of force values representing
  1042. * the custom force. If multiple channels are provided,
  1043. * then the values are interleaved.
  1044. * For example, if <e DICUSTOMFORCE.cChannels>
  1045. * is 3, then the first element of the array belongs to
  1046. * the first channel, the second to the second, and the
  1047. * third to the third.
  1048. *
  1049. ****************************************************************************/
  1050. enddoc
  1051. typedef struct DICUSTOMFORCE {
  1052. DWORD cChannels;
  1053. DWORD dwSamplePeriod;
  1054. DWORD cSamples;
  1055. LPLONG rglForceData;
  1056. } DICUSTOMFORCE, *LPDICUSTOMFORCE;
  1057. typedef const DICUSTOMFORCE *LPCDICUSTOMFORCE;
  1058. ;begin_public_900
  1059. begindoc
  1060. /****************************************************************************
  1061. *
  1062. * @doc EXTERNAL
  1063. *
  1064. * @flags ISSUE-2001/03/29-timgill Need to be complete documentation|
  1065. * @flag DIBEF_OUTERLOWENABLE |
  1066. *
  1067. *
  1068. * Set to enable the outer layer of the Valid only for <mf IDirectInputDevice2::EnumEffects>:
  1069. * Enumerate all effects,
  1070. * regardless of type. This flag may not be combined
  1071. * with any of the other flags.
  1072. *
  1073. * @comm
  1074. * Types:
  1075. * SNAP_TO -ve spring to zero
  1076. * EDGE +ve spring to zero
  1077. * WALL +ve force to max, end on leaving
  1078. * LIMIT +ve force to max, end on returning
  1079. *
  1080. * overlapping -> directional
  1081. *
  1082. * ? use flags to determine some behaviors (where wall ends...)
  1083. * @devnote
  1084. * This type of effect is new for DirectX 9.0.
  1085. *
  1086. ****************************************************************************/
  1087. enddoc
  1088. #define DIBEF_OUTERLOWENABLE 0x00000001
  1089. #define DIBEF_INNERLOWENABLE 0x00000002
  1090. #define DIBEF_OUTERHIGHENABLE 0x00000004
  1091. #define DIBEF_INNERHIGHENABLE 0x00000008
  1092. begindoc
  1093. /****************************************************************************
  1094. *
  1095. * @doc EXTERNAL
  1096. *
  1097. * @struct DIBARRIERFORCE |
  1098. *
  1099. * The <t DIBARRIERFORCE> structure contains
  1100. * type-specific information for effects
  1101. * which are marked as <c DIEFT_BARRIERFORCE>.
  1102. *
  1103. * A pointer to an array of <t DIBARRIERFORCE> structures for
  1104. * an effect is passed in the <e DIEFFECT.lpvTypeSpecificParams>
  1105. * field of the <t DIEFFECT> structure. The number of elements
  1106. * in the array must be equal to the number of axes associated
  1107. * with the effect.
  1108. *
  1109. * @field DWORD | dwBarrierFlags |
  1110. *
  1111. * It consists of one or more <c DIBEF_*> flag values.
  1112. *
  1113. * @field LONG | lStart |
  1114. *
  1115. * The position at which the region starts to be active, in the
  1116. * range -10000 to +10000. (The region is active at this point.)
  1117. *
  1118. * @field LONG | lEnd |
  1119. *
  1120. * The position at which the region ends being active, in the
  1121. * range -10000 to +10000. (The region is active at this point.)
  1122. * This value must be more positive than <e DIREGION.lStart>.
  1123. *
  1124. * @field DWORD | dwOuterThickness |
  1125. *
  1126. * The width in device units of the outer layer of the barrier.
  1127. *
  1128. * @field DWORD | dwOuterSaturation |
  1129. *
  1130. * The maximum force output used to generate the outer layer of
  1131. * the boundary, in the range 0 to 10000.
  1132. *
  1133. * If the device does not support force saturations,
  1134. * then the value of this field is ignored.
  1135. *
  1136. * @field DWORD | dwOuterCoefficient |
  1137. *
  1138. * The coefficient constant for the outer layer of the boundary,
  1139. * in the range 0 to 10000.
  1140. * The sign of the coefficient used is determined by the
  1141. * semantics of the barrier being created.
  1142. *
  1143. * @field DWORD | dwInnerThickness |
  1144. *
  1145. * The width in device units of the inner layer of the barrier.
  1146. *
  1147. * @field DWORD | dwInnerSaturation |
  1148. *
  1149. * The maximum force output used to generate the inner layer of
  1150. * the boundary, in the range 0 to 10000.
  1151. * This value is ignored if <e DIBARRIERFORCE.lOuterCoefficient>
  1152. * is greater than <e DIBARRIERFORCE.lInnerCoefficient>.
  1153. *
  1154. * If the device does not support force saturations,
  1155. * then the value of this field is ignored.
  1156. *
  1157. * @field DWORD | dwInnerCoefficient |
  1158. *
  1159. * The coefficient constant for the inner layer of the boundary,
  1160. * in the range 0 to 10000.
  1161. * The sign of the coefficient used is determined by the
  1162. * semantics of the barrier being created.
  1163. * The semantics of some barriers imply that this value be treated
  1164. * as zero.
  1165. *
  1166. * @comm
  1167. * Types:
  1168. * SNAP_TO -ve spring to zero
  1169. * EDGE +ve spring to zero
  1170. * WALL +ve force to max, end on leaving
  1171. * LIMIT +ve force to max, end on returning
  1172. *
  1173. * overlapping -> directional
  1174. *
  1175. * ? use flags to determine some behaviors (where wall ends...)
  1176. * @devnote
  1177. * This type of effect is new for DirectX 9.0.
  1178. *
  1179. ****************************************************************************/
  1180. enddoc
  1181. typedef struct DIBARRIERFORCE {
  1182. DWORD dwBarrierFlags;
  1183. LONG lStart;
  1184. LONG lEnd;
  1185. DWORD dwOuterThickness;
  1186. DWORD dwOuterSaturation;
  1187. DWORD dwOuterCoefficient;
  1188. DWORD dwInnerThickness;
  1189. DWORD dwInnerSaturation;
  1190. DWORD dwInnerCoefficient;
  1191. } DIBARRIERFORCE, *LPDIBARRIERFORCE;
  1192. typedef const DIBARRIERFORCE *LPCDIBARRIERFORCE;
  1193. ;end_public_900
  1194. begindoc
  1195. /****************************************************************************
  1196. *
  1197. * @doc EXTERNAL
  1198. *
  1199. * @struct DIENVELOPE |
  1200. *
  1201. * The <t DIENVELOPE> structure is used by the
  1202. * <t DIEFFECT> structure to specify the optional
  1203. * envelope parameters for an effect.
  1204. *
  1205. * @field DWORD | dwSize |
  1206. *
  1207. * Specifies the size, in bytes, of the structure.
  1208. * This field "must" be initialized by the application
  1209. * before passing it to any DirectInput interface.
  1210. *
  1211. * @field DWORD | dwAttackLevel |
  1212. *
  1213. * Amplitude for the start of the envelope, relative
  1214. * to the baseline, in the range 0 to 10000.
  1215. * If the effect's type-specific data does not specify
  1216. * a baseline, then the amplitude is relative to zero.
  1217. *
  1218. * @field DWORD | dwAttackTime |
  1219. *
  1220. * The rise time, in microseconds, to reach the sustain level.
  1221. *
  1222. * @field DWORD | dwFadeLevel |
  1223. *
  1224. * Amplitude for the end of the envelope, relative
  1225. * to the baseline, in the range 0 to 10000.
  1226. * If the effect's type-specific data does not specify
  1227. * a baseline, then the amplitude is relative to zero.
  1228. *
  1229. * @field DWORD | dwFadeTime |
  1230. *
  1231. * The fade time, in microseconds, to reach the fade level.
  1232. *
  1233. ****************************************************************************/
  1234. enddoc
  1235. typedef struct DIENVELOPE {
  1236. DWORD dwSize; /* sizeof(DIENVELOPE) */
  1237. DWORD dwAttackLevel;
  1238. DWORD dwAttackTime; /* Microseconds */
  1239. DWORD dwFadeLevel;
  1240. DWORD dwFadeTime; /* Microseconds */
  1241. } DIENVELOPE, *LPDIENVELOPE;
  1242. typedef const DIENVELOPE *LPCDIENVELOPE;
  1243. ;begin_public_900
  1244. /****************************************************************************
  1245. *
  1246. * @doc EXTERNAL
  1247. *
  1248. * @struct DIREGION |
  1249. *
  1250. * The <t DIREGION> structure is used by the
  1251. * <t DIEFFECT> structure to specify the optional
  1252. * region parameters for an effect.
  1253. *
  1254. * @field DWORD | dwSize |
  1255. *
  1256. * Specifies the size, in bytes, of the structure.
  1257. * This field "must" be initialized by the application
  1258. * before passing it to any DirectInput interface.
  1259. *
  1260. * @field LONG | lStart |
  1261. *
  1262. * The position at which the region starts to be active, in the
  1263. * range -10000 to +10000. (The region is active at this point.)
  1264. *
  1265. * @field LONG | lEnd |
  1266. *
  1267. * The position at which the region ends being active, in the
  1268. * range -10000 to +10000. (The region is active at this point.)
  1269. * This value must be more positive than <e DIREGION.lStart>.
  1270. *
  1271. * @field LONG | lDirection |
  1272. *
  1273. * A <t LONG> containing either cartesian coordinates or polar
  1274. * coordinates. The flags <c DIEFF_REGIONCARTESIAN>,
  1275. * <c DIEFF_REGIONPOLAR> and <c DIEFF_REGIONSPERICAL>
  1276. * determine the semantics of the value.
  1277. *
  1278. * If cartesian, then the <e DIREGION.lDirection> value
  1279. * is associated with the corresponding axis in
  1280. * <e DIEFFECT.rgdwAxes>.
  1281. *
  1282. * If polar, then the <e DIREGION.lDirection> value is an angle
  1283. * measured in hundredths of degrees.
  1284. * See the definition of <e DIEFFECT.rglDirection> for details.
  1285. *
  1286. *
  1287. * @comm
  1288. *
  1289. * If an effect has a multidimensional region, the effect is only
  1290. * active when the position reported by all axes falls within the
  1291. * area/space/segment defining the region.
  1292. *
  1293. * If an effect is defined on an axis but a region is not, the axis
  1294. * has an implicite region of with <e DIREGION.lStart> = -10,000,
  1295. * <e DIREGION.lEnd> = 10,000 and <e DIREGION.lDirection> = 0.
  1296. *
  1297. * If the DIEFF_REGIONINVERT flag is used, the associated effect
  1298. * inactive within this region but active outside.
  1299. *
  1300. * @devnote
  1301. * This parameter is new for DirectX 9.0.
  1302. *
  1303. ****************************************************************************/
  1304. enddoc
  1305. typedef struct DIREGION {
  1306. DWORD dwSize;
  1307. LONG lStart;
  1308. LONG lEnd;
  1309. LONG lDirection;
  1310. } DIREGION, *LPDIREGION;
  1311. ;end_public_900
  1312. begindoc
  1313. /****************************************************************************
  1314. *
  1315. * @doc EXTERNAL
  1316. *
  1317. * @struct DIEFFECT |
  1318. *
  1319. * The <t DIEFFECT> structure is used by the
  1320. * <mf IDirectInputDevice2::CreateEffect> method
  1321. * to initialize a new <i IDirectInputEffect> object.
  1322. * It is also used by <mf IDirectInputEffect::SetParameters>.
  1323. *
  1324. * All magnitude and gain values used by DirectInput
  1325. * are uniform and linear across the range. For example,
  1326. * an effect is played at magnitude <y n> will be exactly
  1327. * half as strong as an effect played at magnitude <y 2n>.
  1328. * Any nonlinearity in the physical device will be
  1329. * handled out by the device driver.
  1330. *
  1331. * @field DWORD | dwSize |
  1332. *
  1333. * Specifies the size, in bytes, of the structure.
  1334. * This field "must" be initialized by the application
  1335. * before passing it to any DirectInput interface.
  1336. *
  1337. * @field DWORD | dwFlags |
  1338. *
  1339. * Flags associated with the effect.
  1340. *
  1341. * It consists of one or more <c DIEFF_*> flag values.
  1342. *
  1343. * @field DWORD | dwDuration |
  1344. *
  1345. * The total duration of the effect in microseconds.
  1346. *
  1347. * If this value is <c INFINITE>, then the effect
  1348. * has infinite duration. If an envelope has been
  1349. * applied to the effect, then the attack will be
  1350. * applied, followed by an infinite sustain.
  1351. *
  1352. * @field DWORD | dwSamplePeriod |
  1353. *
  1354. * The period at which the device should play back
  1355. * the effect, in microseconds.
  1356. * A value of zero indicates that the
  1357. * default playback sample rate should be used.
  1358. *
  1359. * If the device is not capable of playing back the
  1360. * effect at the specified rate, it will choose the
  1361. * supported rate that is closest to the requested
  1362. * valid.
  1363. *
  1364. * Setting a custom <e DIEFFECT.dwSamplePeriod>
  1365. * can be used for special effects. For example,
  1366. * playing a sine wave at an artificially large
  1367. * sample period results in a rougher texture.
  1368. *
  1369. * @field DWORD | dwGain |
  1370. *
  1371. * The gain to be applied to the effect, in the
  1372. * range 0 to 10,000. The gain is a scaling factor
  1373. * applied to all magnitudes of the effect and its
  1374. * envelope.
  1375. *
  1376. * @field DWORD | dwTriggerButton |
  1377. *
  1378. * The identifier or offset of the button to be used
  1379. * to trigger playback of the effect.
  1380. * The flags
  1381. * <c DIEFF_OBJECTIDS> and <c DIEFF_OBJECTOFFSETS>
  1382. * determines the semantics of the value.
  1383. *
  1384. * If this field is set to <c DIEB_NOTRIGGER>,
  1385. * then no trigger button is associated with the effect.
  1386. *
  1387. * @field DWORD | dwTriggerRepeatInterval |
  1388. *
  1389. * The delay, in microseconds, before restarting the
  1390. * effect when triggered by a button press.
  1391. *
  1392. * If this field is set to <c INFINITE> then the
  1393. * effect does not auto-repeat.
  1394. *
  1395. * @field DWORD | cAxes |
  1396. *
  1397. * Number of axes involved in the effect.
  1398. * This field must be filled in by the caller if
  1399. * changing/setting the axis list or the direction list.
  1400. *
  1401. * The number of axes for an effect cannot be changed
  1402. * once it has been set.
  1403. *
  1404. * @field LPDWORD | rgdwAxes |
  1405. *
  1406. * Pointer to a <t DWORD> array (of <e DIEFFECT.cAxes>
  1407. * elements) containing identifiers
  1408. * or offsets identifying the axes to which the effect
  1409. * is to be applied.
  1410. * The flags
  1411. * <c DIEFF_OBJECTIDS> and <c DIEFF_OBJECTOFFSETS>
  1412. * determines the semantics of the values in the array.
  1413. *
  1414. * The list of axes associated with an effect cannot
  1415. * be changed once it has been set.
  1416. *
  1417. * At most 32 axes can be associated with a single effect.
  1418. *
  1419. * @field LPLONG | rglDirection |
  1420. *
  1421. * Pointer to a <t LONG> array (of
  1422. * <e DIEFFECT.cAxes> elements) containing either
  1423. * cartesian coordinates or polar coordinates.
  1424. * The flags
  1425. * <c DIEFF_CARTESIAN> and <c DIEFF_POLAR>
  1426. * determines the semantics of the values in the array.
  1427. *
  1428. * If cartesian, then each value in <e DIEFFECT.rglDirection>
  1429. * is associated with the corresponding axis in
  1430. * <e DIEFFECT.rgdwAxes>.
  1431. *
  1432. * If polar, then the angle is measured in hundredths of
  1433. * degrees from the (0, -1) direction, rotated in the
  1434. * direction of (1, 0).
  1435. * The last field (which would otherwise be the magnitude)
  1436. * is ignored.
  1437. *
  1438. * This particular choice of zero seems bizarre until you
  1439. * apply it to the common scenario of X and Y, in which case
  1440. * a direction of zero means "north" and a direction of
  1441. * 9000 means "east". Note that these values are identical
  1442. * to POV values.
  1443. *
  1444. * If spherical, then the first angle is
  1445. * measured in hundredths of degrees from the
  1446. * (1, 0) direction, rotated in the direction of (0, 1).
  1447. * The second angle (if the number of axes is three or more)
  1448. * is measured in hundredths of degrees
  1449. * towards (0, 0, 1).
  1450. * The third angle (if the number of axes is four or more)
  1451. * is measured in
  1452. * hundredths of degrees towards (0, 0, 0, 1), and so on.
  1453. * The last field (which would otherwise be the magnitude)
  1454. * is ignored.
  1455. *
  1456. * In particular, if the two axes are X and Y,
  1457. * then a value of zero indicates "along the positive X axis"
  1458. * and a value of 9000 indicates "along the positive Y axis".
  1459. *
  1460. * Note also that the <e DIEFFECT.rglDirection> array must
  1461. * contain <e DIEFFECT.cAxes> entries, even if polar
  1462. * or spherical
  1463. * coordinates are given. The last element in the
  1464. * <e DIEFFECT.rglDirection> array in these cases
  1465. * must be zero.
  1466. * (It will be used in future versions of DirectInput.)
  1467. *
  1468. * @field LPDIENVELOPE | lpEnvelope |
  1469. *
  1470. * Optional pointer to a <t DIENVELOPE> structure
  1471. * that describes the envelope to be used by this
  1472. * effect. Note that not all effect types use
  1473. * envelopes. If no envelope is to be applied,
  1474. * then the field should be set to <c NULL>.
  1475. *
  1476. * @field DWORD | cbTypeSpecificParams |
  1477. *
  1478. * Number of bytes of additional type-specific
  1479. * parameters for the corresponding effect type.
  1480. *
  1481. * @field LPVOID | lpvTypeSpecificParams |
  1482. *
  1483. * Pointer to type-specific parameters, or <c NULL>
  1484. * if there are no type-specific parameters.
  1485. *
  1486. * If the effect is of type <c DIEFT_CONDITION>, then
  1487. * this field contains a pointer to an array of
  1488. * <t DICONDITION>
  1489. * structures which define the parameters for the
  1490. * condition.
  1491. *
  1492. * If the effect is of type <c DIEFT_CUSTOMFORCE>, then
  1493. * this field contains a pointer to a
  1494. * <t DICUSTOMFORCE>
  1495. * structure which defines the parameters for the
  1496. * custom force.
  1497. *
  1498. * If the effect is of type <c DIEFT_PERIODIC>, then
  1499. * this field contains a pointer to a
  1500. * <t DIPERIODIC>
  1501. * structure which defines the parameters for the
  1502. * effect.
  1503. *
  1504. * If the effect is of type <c DIEFT_CONSTANTFORCE>, then
  1505. * this field contains a pointer to a
  1506. * <t DICONSTANTFORCE>
  1507. * structure which defines the parameters for the
  1508. * constant force.
  1509. *
  1510. * If the effect is of type <c DIEFT_RAMPFORCE>, then
  1511. * this field contains a pointer to a
  1512. * <t DIRAMPFORCE>
  1513. * structure which defines the parameters for the
  1514. * ramp force.
  1515. *
  1516. ;begin_public_900
  1517. * If the effect is of type <c DIBARRIER>, then this
  1518. * field contains a pointer to an array of <t DIBARRIER>
  1519. * structures which define the parameters for the effect.
  1520. *
  1521. * This type is new for DirectX 9.0.
  1522. *
  1523. ;end_public_900
  1524. * @field DWORD | dwStartDelay |
  1525. *
  1526. * Amount of time (in microseconds) the device should wait
  1527. * after a <mf IDirectInputEffect::Start> call before
  1528. * physically playing the effect. If this value is zero,
  1529. * then effect playback begins immediately.
  1530. *
  1531. * This field is new for DirectX 6.1a.
  1532. *
  1533. ;begin_public_900
  1534. * @field DWORD | cRegions |
  1535. *
  1536. * Number of regions defined for the effect. It is an error
  1537. * to define more regions than axes. Since axes involved in
  1538. * a region must be orthogonal, it is an error to define more
  1539. * than three axes in a region.
  1540. *
  1541. * This field is new for DirectX 9.0.
  1542. *
  1543. * @field LPDIREGION | rgRegions |
  1544. *
  1545. * Pointer to a <t DIREGION> array (of
  1546. * <e DIEFFECT.cRegions> elements) containing the region
  1547. * definition for the effect. The region elements are matched
  1548. * to the <e DIEFFECT.rgdwAxes> elements so axes to which
  1549. * regions are to be applied must be defined first. For
  1550. * example if a vibration is to be applied to all force
  1551. * feedback axes if the X/Y position of the joystick is inside
  1552. * a particular region then the X and Y axes must be the first
  1553. * axes listed in <e DIEFFECT.rgdwAxes>.
  1554. *
  1555. * This field is new for DirectX 9.0.
  1556. *
  1557. ;end_public_900
  1558. ****************************************************************************/
  1559. enddoc
  1560. ;begin_public_600
  1561. /* This structure is defined for DirectX 5.0 compatibility */
  1562. typedef struct DIEFFECT_DX5 {
  1563. DWORD dwSize; /* sizeof(DIEFFECT_DX5) */
  1564. DWORD dwFlags; /* DIEFF_* */
  1565. DWORD dwDuration; /* Microseconds */
  1566. DWORD dwSamplePeriod; /* Microseconds */
  1567. DWORD dwGain;
  1568. DWORD dwTriggerButton; /* or DIEB_NOTRIGGER */
  1569. DWORD dwTriggerRepeatInterval; /* Microseconds */
  1570. DWORD cAxes; /* Number of axes */
  1571. LPDWORD rgdwAxes; /* Array of axes */
  1572. LPLONG rglDirection; /* Array of directions */
  1573. LPDIENVELOPE lpEnvelope; /* Optional */
  1574. DWORD cbTypeSpecificParams; /* Size of params */
  1575. LPVOID lpvTypeSpecificParams; /* Pointer to params */
  1576. } DIEFFECT_DX5, *LPDIEFFECT_DX5;
  1577. typedef const DIEFFECT_DX5 *LPCDIEFFECT_DX5;
  1578. ;end_public_600
  1579. ;begin_public_900
  1580. /* This structure is defined for DirectX 6.0 compatibility */
  1581. typedef struct DIEFFECT_DX6 {
  1582. DWORD dwSize; /* sizeof(DIEFFECT_DX6) */
  1583. DWORD dwFlags; /* DIEFF_* */
  1584. DWORD dwDuration; /* Microseconds */
  1585. DWORD dwSamplePeriod; /* Microseconds */
  1586. DWORD dwGain;
  1587. DWORD dwTriggerButton; /* or DIEB_NOTRIGGER */
  1588. DWORD dwTriggerRepeatInterval; /* Microseconds */
  1589. DWORD cAxes; /* Number of axes */
  1590. LPDWORD rgdwAxes; /* Array of axes */
  1591. LPLONG rglDirection; /* Array of directions */
  1592. LPDIENVELOPE lpEnvelope; /* Optional */
  1593. DWORD cbTypeSpecificParams; /* Size of params */
  1594. LPVOID lpvTypeSpecificParams; /* Pointer to params */
  1595. ;begin_if_(DIRECTINPUT_VERSION)_600
  1596. DWORD dwStartDelay; /* Microseconds */
  1597. ;end
  1598. } DIEFFECT_DX6, *LPDIEFFECT_DX6;
  1599. typedef const DIEFFECT_DX6 *LPCDIEFFECT_DX6;
  1600. ;end_public_900
  1601. typedef struct DIEFFECT {
  1602. DWORD dwSize; /* sizeof(DIEFFECT) */
  1603. DWORD dwFlags; /* DIEFF_* */
  1604. DWORD dwDuration; /* Microseconds */
  1605. DWORD dwSamplePeriod; /* Microseconds */
  1606. DWORD dwGain;
  1607. DWORD dwTriggerButton; /* or DIEB_NOTRIGGER */
  1608. DWORD dwTriggerRepeatInterval; /* Microseconds */
  1609. DWORD cAxes; /* Number of axes */
  1610. LPDWORD rgdwAxes; /* Array of axes */
  1611. LPLONG rglDirection; /* Array of directions */
  1612. LPDIENVELOPE lpEnvelope; /* Optional */
  1613. DWORD cbTypeSpecificParams; /* Size of params */
  1614. LPVOID lpvTypeSpecificParams; /* Pointer to params */
  1615. ;begin_if_(DIRECTINPUT_VERSION)_600
  1616. DWORD dwStartDelay; /* Microseconds */
  1617. ;end
  1618. ;begin_if_(DIRECTINPUT_VERSION)_900
  1619. DWORD cRegions; /* Number of regions */
  1620. LPDIREGION rgRegion; /* Array of Regions */
  1621. ;end
  1622. } DIEFFECT, *LPDIEFFECT;
  1623. #if (DIRECTINPUT_VERSION < 900) ;public_900
  1624. typedef DIEFFECT DIEFFECT_DX6;
  1625. typedef LPDIEFFECT LPDIEFFECT_DX6;
  1626. #endif ;public_900
  1627. typedef const DIEFFECT *LPCDIEFFECT;
  1628. ;begin_internal_600
  1629. /*
  1630. * Name for the latest structures, in places where we specifically care.
  1631. */
  1632. #if (DIRECTINPUT_VERSION >= 900)
  1633. typedef DIEFFECT DIEFFECT_DX9;
  1634. typedef DIEFFECT *LPDIEFFECT_DX9;
  1635. #else
  1636. typedef DIEFFECT DIEFFECT_DX6;
  1637. typedef DIEFFECT *LPDIEFFECT_DX6;
  1638. #endif
  1639. BOOL static __inline
  1640. IsValidSizeDIEFFECT(DWORD cb)
  1641. {
  1642. return cb == sizeof(DIEFFECT_DX6)
  1643. ;begin_if_(DIRECTINPUT_VERSION)_900
  1644. || cb == sizeof(DIEFFECT_DX9)
  1645. ;end
  1646. || cb == sizeof(DIEFFECT_DX5);
  1647. }
  1648. ;end_internal_600
  1649. begindoc
  1650. /****************************************************************************
  1651. *
  1652. * @doc EXTERNAL
  1653. *
  1654. * @struct DIFILEEFFECT |
  1655. *
  1656. * The <t DIFILEEFFECT> structure is used by the
  1657. * <mf IDirectInputDevice7::EnumEffectFromFile> and
  1658. * <mf IDirectInputDevuce7::WriteEffectToFile> methods.
  1659. * These methods are new for DirectInput7.
  1660. *
  1661. * The <t DIFILEEFFECT> structure abstracts the information
  1662. * needed in order to create/store a pre-authored effect.
  1663. *
  1664. * This structure is new for Dx7.
  1665. *
  1666. *
  1667. * @field DWORD | dwSize |
  1668. *
  1669. * Specifies the size, in bytes, of the structure.
  1670. * This field "must" be initialized by the application
  1671. * before passing it to any DirectInput interface.
  1672. *
  1673. * @field GUID | GuidEffect |
  1674. *
  1675. * The GUID to uniquely identify the effect.
  1676. *
  1677. * @field LPDIEFFECT | lpDiEffect |
  1678. *
  1679. * Address of the <t DIEFFECT> structure.
  1680. * The <t DIEFFECT> structure contains pointer to other
  1681. * arrays and structures. If you plan to cache the <t DIEFFECT>
  1682. * structure copy it very carefully.
  1683. *
  1684. * @field CHAR | szFriendlyName |
  1685. *
  1686. * A effect file may have multiple effects of the same type.
  1687. * The FriendlyName field can be used to distuingish the effects.
  1688. *
  1689. ****************************************************************************/
  1690. enddoc
  1691. ;begin_if_(DIRECTINPUT_VERSION)_700
  1692. #ifndef DIJ_RINGZERO
  1693. typedef struct DIFILEEFFECT{
  1694. DWORD dwSize;
  1695. GUID GuidEffect;
  1696. LPCDIEFFECT lpDiEffect;
  1697. CHAR szFriendlyName[MAX_PATH];
  1698. }DIFILEEFFECT, *LPDIFILEEFFECT;
  1699. typedef const DIFILEEFFECT *LPCDIFILEEFFECT;
  1700. typedef BOOL (FAR PASCAL * LPDIENUMEFFECTSINFILECALLBACK)(LPCDIFILEEFFECT , LPVOID);
  1701. #endif /* DIJ_RINGZERO */
  1702. ;end
  1703. ;internal
  1704. #define DIEFFECT_MAXAXES 32 ;internal
  1705. begindoc
  1706. /****************************************************************************
  1707. *
  1708. * @doc EXTERNAL
  1709. *
  1710. * @define DIEFF_OBJECTIDS | 0x00000001 |
  1711. *
  1712. * Value for the <e DIEFFECT.dwFlags> field of the
  1713. * <t DIEFFECT> structure indicating that the
  1714. * values of <e DIEFFECT.dwTriggerButton> and
  1715. * <e DIEFFECT.rgdwAxes> are object identifiers
  1716. * as obtained via <mf IDirectInput::EnumObjects>.
  1717. *
  1718. * @define DIEFF_OBJECTOFFSETS | 0x00000002 |
  1719. *
  1720. * Value for the <e DIEFFECT.dwFlags> field of the
  1721. * <t DIEFFECT> structure indicating that the
  1722. * values of <e DIEFFECT.dwTriggerButton> and
  1723. * <e DIEFFECT.rgdwAxes> are data format offsets,
  1724. * relative to the data format selected by
  1725. * as obtained via <mf IDirectInput::SetDataFormat>.
  1726. *
  1727. * @define DIEFF_CARTESIAN | 0x00000010 |
  1728. *
  1729. * Value for the <e DIEFFECT.dwFlags> field of the
  1730. * <t DIEFFECT> structure indicating that the
  1731. * values of
  1732. * <e DIEFFECT.rglDirection> are to be interpreted
  1733. * as cartesian coordinates.
  1734. *
  1735. * @define DIEFF_POLAR | 0x00000020 |
  1736. *
  1737. * Value for the <e DIEFFECT.dwFlags> field of the
  1738. * <t DIEFFECT> structure indicating that the
  1739. * values of
  1740. * <e DIEFFECT.rglDirection> are to be interpreted
  1741. * as polar coordinates.
  1742. *
  1743. * Polar coordinates are valid only if the number
  1744. * of axes is exactly two. If the two axes are
  1745. * X and Y (respectively), then a direction of zero
  1746. * corresponds to due north, and angles increase
  1747. * clockwise.
  1748. *
  1749. * @define DIEFF_SPHERICAL | 0x00000040 |
  1750. *
  1751. * Value for the <e DIEFFECT.dwFlags> field of the
  1752. * <t DIEFFECT> structure indicating that the
  1753. * values of
  1754. * <e DIEFFECT.rglDirection> are to be interpreted
  1755. * as spherical coordinates.
  1756. *
  1757. * Let the axes of the effect be named X1, X2, etc.
  1758. * Spherical coordinates begin with a vector along
  1759. * the positive X1 axis. The vector is then rotated
  1760. * in the direction of the positive X2 axis by
  1761. * the first angle, then in the direction of the
  1762. * positive X3 axis by the second angle, and so on.
  1763. *
  1764. ;begin_public_900
  1765. * @define DIEFF_REGIONINVERT | 0x00000100 |
  1766. *
  1767. * Value for the <e DIEFFECT.dwFlags> field of the
  1768. * <t DIEFFECT> structure indicating that the effect
  1769. * should only be active outside the area described by
  1770. * <e DIEFFECT.rgRegion>.
  1771. *
  1772. * This flag is new for DirectX 9.0.
  1773. *
  1774. * @define DIEFF_REGIONALLAXES | 0x00000200 |
  1775. *
  1776. * Value for the <e DIEFFECT.dwFlags> field of the
  1777. * <t DIEFFECT> structure indicating that orthogonal
  1778. * input only axes should not be ignored.
  1779. * By default, values of a region relating to axes
  1780. * for which this device does not support force feedback
  1781. * should be ignored so that the presence of non-force
  1782. * feedback axes does not alter the playing of effects.
  1783. *
  1784. * This flag is new for DirectX 9.0.
  1785. *
  1786. * @define DIEFF_REGIONELIPLTICAL | 0x00000400 |
  1787. *
  1788. * Value for the <e DIEFFECT.dwFlags> field of the
  1789. * <t DIEFFECT> structure indicating that the
  1790. * values of <e DIEFFECT.rgRegion> are to be interpreted
  1791. * as bounding an elptical region.
  1792. *
  1793. * If the region is only being evaluated in one dimension, this
  1794. * flag is ignored.
  1795. * If the region is being evaluated in two dimensions, the
  1796. *
  1797. * This flag is new for DirectX 9.0.
  1798. *
  1799. ;end_public_900
  1800. ****************************************************************************/
  1801. enddoc
  1802. #define DIEFF_OBJECTIDS 0x00000001
  1803. #define DIEFF_OBJECTOFFSETS 0x00000002
  1804. #define DIEFF_OBJECTMASK 0x00000003;internal
  1805. #define DIEFF_CARTESIAN 0x00000010
  1806. #define DIEFF_POLAR 0x00000020
  1807. #define DIEFF_SPHERICAL 0x00000040
  1808. #define DIEFF_ANGULAR 0x00000060;internal
  1809. #define DIEFF_COORDMASK 0x00000070;internal
  1810. #define DIEFF_REGIONINVERT 0x00000100;public_900
  1811. #define DIEFF_REGIONALLAXES 0x00000200;public_900
  1812. #define DIEFF_REGIONELIPLTICAL 0x00000400;public_900
  1813. #define DIEFF_REGIONCARTESIAN 0x00001000;public_900
  1814. #define DIEFF_REGIONPOLAR 0x00002000;public_900
  1815. #define DIEFF_REGIONSPHERICAL 0x00004000;public_900
  1816. #define DIEFF_REGIONANGULAR 0x00006000;internal
  1817. #define DIEFF_REGIONCOORDMASK 0x00007000;internal
  1818. ;begin_internal
  1819. #define DIEFF_VALID 0x00000073
  1820. ;begin_if_(DIRECTINPUT_VERSION)_900
  1821. #define DIEFF_VALID_DX5 0x00000073
  1822. #undef DIEFF_VALID
  1823. #define DIEFF_VALID 0x00007073
  1824. ;end
  1825. ;end_internal
  1826. begindoc
  1827. /****************************************************************************
  1828. *
  1829. * @doc EXTERNAL
  1830. *
  1831. * @define DIEP_DURATION | 0x00000001 |
  1832. *
  1833. * Parameter to
  1834. * <mf IDirectInputEffect::GetParameters> or
  1835. * <mf IDirectInputEffect::SetParameters> indicating
  1836. * that the <e DIEFFECT.dwDuration> field contains
  1837. * data or should receive data.
  1838. *
  1839. * @define DIEP_SAMPLEPERIOD | 0x00000002 |
  1840. *
  1841. * Parameter to
  1842. * <mf IDirectInputEffect::GetParameters> or
  1843. * <mf IDirectInputEffect::SetParameters> indicating
  1844. * that the <e DIEFFECT.dwSamplePeriod> field contains
  1845. * data or should receive data.
  1846. *
  1847. * @define DIEP_GAIN | 0x00000004 |
  1848. *
  1849. * Parameter to
  1850. * <mf IDirectInputEffect::GetParameters> or
  1851. * <mf IDirectInputEffect::SetParameters> indicating
  1852. * that the <e DIEFFECT.dwGain> field contains
  1853. * data or should receive data.
  1854. *
  1855. * @define DIEP_TRIGGERBUTTON | 0x00000008 |
  1856. *
  1857. * Parameter to
  1858. * <mf IDirectInputEffect::GetParameters> or
  1859. * <mf IDirectInputEffect::SetParameters> indicating
  1860. * that the <e DIEFFECT.dwTriggerButton> field contains
  1861. * data or should receive data.
  1862. *
  1863. * @define DIEP_TRIGGERREPEATINTERVAL | 0x00000010 |
  1864. *
  1865. * Parameter to
  1866. * <mf IDirectInputEffect::GetParameters> or
  1867. * <mf IDirectInputEffect::SetParameters> indicating
  1868. * that the <e DIEFFECT.dwTriggerRepeatInterval> field contains
  1869. * data or should receive data.
  1870. *
  1871. * @define DIEP_AXES | 0x00000020 |
  1872. *
  1873. * Parameter to
  1874. * <mf IDirectInputEffect::GetParameters> or
  1875. * <mf IDirectInputEffect::SetParameters> indicating
  1876. * that the <e DIEFFECT.cAxes> and
  1877. * <e DIEFFECT.rgdwAxes> fields contain
  1878. * data or should receive data.
  1879. *
  1880. * For <mf IDirectInputEffect::GetParameters>, the
  1881. * <e DIEFFECT.cAxes> field on entry contains the
  1882. * sizes (in <t DWORD>s) of the buffer pointed to
  1883. * by the <e DIEFFECT.rgdwAxes> field.
  1884. * If the buffer is too small, then
  1885. * <mf IDirectInputEffect::GetParameters>
  1886. * returns <c DIERR_MOREDATA> and sets
  1887. * <e DIEFFECT.cAxes> to the necessary size of the buffer.
  1888. *
  1889. * @define DIEP_DIRECTION | 0x00000040 |
  1890. *
  1891. * Parameter to
  1892. * <mf IDirectInputEffect::GetParameters> or
  1893. * <mf IDirectInputEffect::SetParameters> indicating
  1894. * that the <e DIEFFECT.cAxes> and
  1895. * <e DIEFFECT.rglDirection> fields contain
  1896. * data or should receive data.
  1897. *
  1898. * For <mf IDirectInputEffect::GetParameters>, the
  1899. * <e DIEFFECT.cAxes> field on entry contains the
  1900. * size (in <t DWORD>s) of the buffer pointed to
  1901. * by the <e DIEFFECT.rglDirection> field.
  1902. * If the buffer is too small, then
  1903. * <mf IDirectInputEffect::GetParameters>
  1904. * returns <c DIERR_MOREDATA> and sets
  1905. * <e DIEFFECT.cAxes> to the necessary size of the buffer.
  1906. *
  1907. * The <e DIEFFECT.dwFlags> field specifies
  1908. * (via <c DIEFF_CARTESIAN> or <c DIEFF_POLAR>)
  1909. * the coordinate system in which the values should
  1910. * be interpreted.
  1911. *
  1912. * @define DIEP_ENVELOPE | 0x00000080 |
  1913. *
  1914. * Parameter to
  1915. * <mf IDirectInputEffect::GetParameters> or
  1916. * <mf IDirectInputEffect::SetParameters> indicating
  1917. * that the <e DIEFFECT.lpEnvelope> field points to
  1918. * a <t DIENVELOPE> structure which contains
  1919. * data or should receive data.
  1920. *
  1921. * @define DIEP_TYPESPECIFICPARAMS | 0x00000100 |
  1922. *
  1923. * Parameter to
  1924. * <mf IDirectInputEffect::GetParameters> or
  1925. * <mf IDirectInputEffect::SetParameters> indicating
  1926. * that the <e DIEFFECT.cbTypeSpecificParams> and
  1927. * <e DIEFFECT.lpTypeSpecificParams> fields contain
  1928. * data or should receive data.
  1929. *
  1930. * Note that the buffer pointed to by
  1931. * <e DIEFFECT.lpTypeSpecificParams> must remain valid
  1932. * for the lifetime of the effect (or until the
  1933. * type-specific parameter is set to a new value).
  1934. * DirectInput does not make a private copy of the
  1935. * buffer.
  1936. *
  1937. * When retrieving the type-specific parameters, DirectInput
  1938. * merely returns the pointers as originally passed to
  1939. * <mf IDirectInputEffect::SetParameters>
  1940. * (or implicitly via <mf IDirectInputDevice2::CreateEffect>)
  1941. *
  1942. * @define DIEP_STARTDELAY | 0x00000200 |
  1943. *
  1944. * Parameter to
  1945. * <mf IDirectInputEffect::GetParameters> or
  1946. * <mf IDirectInputEffect::SetParameters> indicating
  1947. * that the <e DIEFFECT.dwStartDelay> field contains
  1948. * data or should receive data.
  1949. *
  1950. * This flag is new for DirectX 6.1a.
  1951. *
  1952. * @define DIEP_REGION | 0x00000400 |
  1953. *
  1954. * Parameter to
  1955. * <mf IDirectInputEffect::GetParameters> or
  1956. * <mf IDirectInputEffect::SetParameters> indicating
  1957. * that the <e DIEFFECT.cRegions> and
  1958. * <e DIEFFECT.rgRegion > fields contain
  1959. * data or should receive data.
  1960. *
  1961. * For <mf IDirectInputEffect::GetParameters>, the
  1962. * <e DIEFFECT.cRegions> field on entry contains the
  1963. * size (in <t DIREGION>s) of the buffer pointed to
  1964. * by the <e DIEFFECT.rgRegion> field.
  1965. * If the buffer is too small, then
  1966. * <mf IDirectInputEffect::GetParameters>
  1967. * returns <c DIERR_MOREDATA> and sets
  1968. * <e DIEFFECT.cRegions> to the necessary size of the buffer.
  1969. *
  1970. * The <e DIEFFECT.dwFlags> field specifies
  1971. * (via the <c DIEFF_REGION*> flags) how the values
  1972. * stored in <e DIEFFECT.rgRegion> should be interpreted.
  1973. *
  1974. * This flag is new for DirectX 9.0.
  1975. *
  1976. * @define DIEP_ALLPARAMS | 0x000007FF |
  1977. *
  1978. * The union of all other <c DIEP_*> flags, indicating that
  1979. * all fields of the <t DIEFFECT> structure are valid
  1980. * or are being requested.
  1981. *
  1982. * If the <c DIRECTINPUT_VERSION> is set to a value less
  1983. * than 0x0800, then the value of this macro is
  1984. * <c 0x000003FF>, omitting flags not supported by earlier
  1985. * versions of DirectX.
  1986. *
  1987. * If the <c DIRECTINPUT_VERSION> is set to a value less
  1988. * than 0x0600, then the value of this macro is
  1989. * <c 0x000001FF>, omitting flags not supported by earlier
  1990. * versions of DirectX.
  1991. *
  1992. * @define DIEP_START | 0x20000000 |
  1993. *
  1994. * Additional flag which may be passed to
  1995. * <mf IDirectInputEffect::SetParameters> to indicate that
  1996. * after the parameters of the effect have been updated,
  1997. * the effect is to be restarted from the beginning.
  1998. *
  1999. * Setting this flag is equivalent to immediately calling
  2000. * <mf IDirectInputEffect::Start>(1, 0) after a successful
  2001. * call to
  2002. * <mf IDirectInputEffect::SetParameters>.
  2003. *
  2004. * Note that the <c DIEP_NODOWNLOAD> flag overrides the
  2005. * <c DIEP_NORESTART> flag.
  2006. *
  2007. * @define DIEP_NORESTART | 0x40000000 |
  2008. *
  2009. * Additional flag which may be passed to
  2010. * <mf IDirectInputEffect::SetParameters> to indicate that
  2011. * if the hardware cannot update the parameters while the
  2012. * effect is playing, it should return <c DIERR_EFFECTPLAYING>
  2013. * without updating the parameters of the effect.
  2014. *
  2015. * If this flag is not specified, then the effect device
  2016. * driver is permitted to restart the effect if doing so
  2017. * is necessary in order to change the specified parameters.
  2018. *
  2019. * Note that the <c DIEP_NODOWNLOAD> and
  2020. * <c DIEP_START> flags override the
  2021. * <c DIEP_NORESTART> flag.
  2022. *
  2023. * @define DIEP_NODOWNLOAD | 0x80000000 |
  2024. *
  2025. * Additional flag which may be passed to
  2026. * <mf IDirectInputEffect::SetParameters> to suppress the
  2027. * automatic <mf IDirectInputEffect::Download> that is
  2028. * normally performed after the parameters are updated.
  2029. *
  2030. * @define DIEB_NOTRIGGER | 0xFFFFFFFF |
  2031. *
  2032. * A special value for the <e DIEFFECT.dwTriggerButton> field
  2033. * of the <t DIEFFECT> structure, indicating that the effect
  2034. * is not associated with a button.
  2035. *
  2036. ****************************************************************************/
  2037. /*
  2038. * Note! If you add new effect parameters, you must adjust CDIEff_Reset
  2039. * to initialize them to sane default values, or to set the bit in
  2040. * diepUnset to make sure they get set eventually.
  2041. *
  2042. ****************************************************************************/
  2043. enddoc
  2044. #define DIEP_DURATION 0x00000001
  2045. #define DIEP_SAMPLEPERIOD 0x00000002
  2046. #define DIEP_GAIN 0x00000004
  2047. #define DIEP_TRIGGERBUTTON 0x00000008
  2048. #define DIEP_TRIGGERREPEATINTERVAL 0x00000010
  2049. #define DIEP_AXES 0x00000020
  2050. #define DIEP_DIRECTION 0x00000040
  2051. #define DIEP_ENVELOPE 0x00000080
  2052. #define DIEP_TYPESPECIFICPARAMS 0x00000100
  2053. #if(DIRECTINPUT_VERSION >= 0x0600) ;public_600
  2054. #define DIEP_STARTDELAY 0x00000200;public_600
  2055. #if(DIRECTINPUT_VERSION >= 0x0900) ;public_900
  2056. #define DIEP_REGION 0x00000400;public_900
  2057. #endif ;public_900
  2058. #endif ;public_900
  2059. ;public_900
  2060. #if(DIRECTINPUT_VERSION >= 0x0600) ;public_900
  2061. #define DIEP_ALLPARAMS_DX5 0x000001FF;public_600
  2062. # if(DIRECTINPUT_VERSION >= 0x0900) ;public_900
  2063. #define DIEP_ALLPARAMS_DX6 0x000003FF;public_900
  2064. #define DIEP_ALLPARAMS 0x000007FF;public_900
  2065. # else ;public_900
  2066. #define DIEP_ALLPARAMS 0x000003FF;public_600
  2067. # endif ;public_900
  2068. #else /* DIRECTINPUT_VERSION < 0x0600 */ ;public_600
  2069. #define DIEP_ALLPARAMS 0x000001FF
  2070. #endif /* DIRECTINPUT_VERSION < 0x0600 */ ;public_600
  2071. ;public_900
  2072. #define DIEP_START 0x20000000
  2073. #define DIEP_NORESTART 0x40000000
  2074. #define DIEP_NODOWNLOAD 0x80000000
  2075. #define DIEP_GETVALID 0x000001FF;internal_dx5
  2076. #define DIEP_SETVALID 0xE00001FF;internal_dx5
  2077. #define DIEP_GETVALID_DX5 0x000001FF;internal_600
  2078. #define DIEP_SETVALID_DX5 0xE00001FF;internal_600
  2079. #define DIEP_GETVALID 0x000003FF;internal_dx6
  2080. #define DIEP_SETVALID 0xE00003FF;internal_dx6
  2081. #define DIEP_GETVALID 0x000003FF;internal_700
  2082. #define DIEP_SETVALID 0xE00003FF;internal_700
  2083. #define DIEP_GETVALID 0x000007FF;internal_900
  2084. #define DIEP_SETVALID 0xE00007FF;internal_900
  2085. #define DIEP_USESOBJECTS 0x00000028;internal_500
  2086. #define DIEP_USESCOORDS 0x00000040;internal_500
  2087. #define DIEB_NOTRIGGER 0xFFFFFFFF
  2088. begindoc
  2089. /****************************************************************************
  2090. *
  2091. * @doc EXTERNAL
  2092. *
  2093. * @define DIES_SOLO | 0x00000001 |
  2094. *
  2095. * Parameter to
  2096. * <mf IDirectInputEffect::Start> indicating
  2097. * that all other effects on the device should be
  2098. * stopped before the specified effect is played.
  2099. * If this flag is omitted, then the effect is
  2100. * mixed with existing effects already started
  2101. * on the device.
  2102. *
  2103. * @define DIES_NODOWNLOAD | 0x80000000 |
  2104. *
  2105. * Parameter to
  2106. * <mf IDirectInputEffect::Start> indicating
  2107. * that if the effect has not been downloaded,
  2108. * then the attempt to play the effect should
  2109. * fail with the error code <c DIERR_NOTDOWNLOADED>.
  2110. * If this flag is omitted, then the effect
  2111. * will be downloaded if necessary.
  2112. *
  2113. ****************************************************************************/
  2114. enddoc
  2115. #define DIES_SOLO 0x00000001
  2116. #define DIES_NODOWNLOAD 0x80000000
  2117. #define DIES_VALID 0x80000001;internal_500
  2118. #define DIES_DRIVER 0x00000001;internal_500
  2119. begindoc
  2120. /****************************************************************************
  2121. *
  2122. * @doc EXTERNAL
  2123. *
  2124. * @define DIEGES_PLAYING | 0x00000001 |
  2125. *
  2126. * Status code produced by
  2127. * <mf IDirectInputEffect::GetEffectStatus> indicating
  2128. * that the effect is still playing.
  2129. *
  2130. * @define DIEGES_EMULATED | 0x00000002 |
  2131. *
  2132. * Status code produced by
  2133. * <mf IDirectInputEffect::GetEffectStatus> indicating
  2134. * that the effect is emulated.
  2135. *
  2136. ****************************************************************************/
  2137. enddoc
  2138. #define DIEGES_PLAYING 0x00000001
  2139. #define DIEGES_EMULATED 0x00000002
  2140. begindoc
  2141. /****************************************************************************
  2142. *
  2143. * @doc EXTERNAL
  2144. *
  2145. * @struct DIEFFESCAPE |
  2146. *
  2147. * Structure used by the
  2148. * <mf IDirectInputEffect::Escape> method
  2149. * to pass hardware-specific data directly to the device driver.
  2150. *
  2151. * Since each driver implements different escapes,
  2152. * it is the application's responsibility to ensure that
  2153. * it is talking to the correct driver by comparing the
  2154. * <e DIDEVICEINSTANCE.guidFFDriver> in the
  2155. * <t DIDEVICEINSTANCE> structure against the
  2156. * value the application is expecting.
  2157. *
  2158. * @field DWORD | dwSize |
  2159. *
  2160. * Size of the structure in bytes.
  2161. *
  2162. * @field DWORD | dwCommand |
  2163. *
  2164. * Driver-specific command number.
  2165. * Consult the driver
  2166. * documentation for a list of valid commands.
  2167. *
  2168. * @field LPVOID | lpvInBuffer |
  2169. *
  2170. * Points to a buffer containing the data required to perform
  2171. * the operation.
  2172. *
  2173. * @field DWORD | cbInBuffer |
  2174. *
  2175. * Specifies the size, in bytes, of the <e DIEFFESCAPE.lpvInBuffer>
  2176. * buffer.
  2177. *
  2178. * @field LPVOID | lpvOutBuffer |
  2179. *
  2180. * Points to a buffer in which the operation's output data is
  2181. * returned.
  2182. *
  2183. * @field DWORD | cbOutBuffer |
  2184. *
  2185. * On entry, specifies the size, in bytes, of the
  2186. * <e DIEFFESCAPE.lpvOutBuffer>
  2187. * buffer. On exit, specifies the number of bytes
  2188. * actually produced by the command.
  2189. *
  2190. ****************************************************************************/
  2191. enddoc
  2192. typedef struct DIEFFESCAPE {
  2193. DWORD dwSize;
  2194. DWORD dwCommand;
  2195. LPVOID lpvInBuffer;
  2196. DWORD cbInBuffer;
  2197. LPVOID lpvOutBuffer;
  2198. DWORD cbOutBuffer;
  2199. } DIEFFESCAPE, *LPDIEFFESCAPE;
  2200. #ifndef DIJ_RINGZERO
  2201. begin_interface(IDirectInputEffect)
  2202. begin_methods()
  2203. declare_method(Initialize, HINSTANCE, DWORD, REFGUID)
  2204. declare_method(GetEffectGuid, LPGUID)
  2205. declare_method(GetParameters, LPDIEFFECT, DWORD)
  2206. declare_method(SetParameters, LPCDIEFFECT, DWORD)
  2207. declare_method(Start, DWORD, DWORD)
  2208. declare_method(Stop)
  2209. declare_method(GetEffectStatus, LPDWORD)
  2210. declare_method(Download)
  2211. declare_method(Unload)
  2212. declare_method(Escape, LPDIEFFESCAPE)
  2213. end_methods()
  2214. end_interface()
  2215. #endif /* DIJ_RINGZERO */
  2216. ;end
  2217. /****************************************************************************
  2218. *
  2219. * IDirectInputDevice
  2220. *
  2221. ****************************************************************************/
  2222. begindoc
  2223. /****************************************************************************
  2224. *
  2225. * @doc EXTERNAL
  2226. *
  2227. * @topic DirectInput device type description codes |
  2228. *
  2229. * The least-significant byte of the device type description code
  2230. * specifies the device type.
  2231. * DInput 7 and below use one set of values DInput 8 uses a
  2232. * different set.
  2233. *
  2234. * DInput 7 and earlier types:
  2235. *
  2236. * <c DIDEVTYPE_DEVICE>: A device which does not fall into
  2237. * any of the following categories.
  2238. *
  2239. * <c DIDEVTYPE_MOUSE>: A mouse or mouse-like device (such as
  2240. * a trackball).
  2241. *
  2242. * <c DIDEVTYPE_KEYBOARD>: A keyboard or keyboard-like device.
  2243. *
  2244. * <c DIDEVTYPE_JOYSTICK>: A joystick or joystick-like device (such
  2245. * as a steering wheel).
  2246. *
  2247. * DInput 8 types:
  2248. *
  2249. * <c DI8DEVTYPE_DEVICE>: A device which does not fall into
  2250. * any of the following categories.
  2251. *
  2252. * <c DI8DEVTYPE_MOUSE>: A mouse or mouse-like device (such as
  2253. * a trackball).
  2254. *
  2255. * <c DI8DEVTYPE_KEYBOARD>: A keyboard or keyboard-like device.
  2256. *
  2257. * <c DI8DEVTYPE_JOYSTICK>: A generic joystick device.
  2258. *
  2259. * <c DI8DEVTYPE_GAMEPAD>: A gamepad.
  2260. *
  2261. * <c DI8DEVTYPE_DRIVING>: Some form of steering wheel and
  2262. * associated controls.
  2263. *
  2264. * <c DI8DEVTYPE_FLIGHT>: Some form of flight controller.
  2265. *
  2266. * <c DI8DEVTYPE_1STPERSON>: A device optimized for control from
  2267. * a first person perspective.
  2268. *
  2269. * <c DI8DEVTYPE_SCREENPOINTER>: A device which reports position
  2270. * in terms of screen coordinates that would not normally control
  2271. * the system mouse pointer.
  2272. *
  2273. * <c DI8DEVTYPE_REMOTE>: A remote control device.
  2274. *
  2275. * <c DI8DEVTYPE_DEVICECTRL>: A controller used to modify a real
  2276. * world device from within the context of the application.
  2277. *
  2278. * <c DI8DEVTYPE_SUPPLEMENTAL>: A device with functionality,
  2279. * unsuitable for the main control of an application but specialized
  2280. * towards control a particular type of action.
  2281. *
  2282. *
  2283. * The next-significant byte specifies the device subtype.
  2284. * DInput 7 and below use one set of values DInput 8 uses a
  2285. * different set.
  2286. *
  2287. * DInput 7 and earlier subtypes:
  2288. * For mouse type devices, the following subtypes are defined:
  2289. *
  2290. * <c DIDEVTYPEMOUSE_UNKNOWN>: The subtype could not be
  2291. * determined.
  2292. *
  2293. * <c DIDEVTYPEMOUSE_TRADITIONAL>: A traditional mouse.
  2294. *
  2295. * <c DIDEVTYPEMOUSE_FINGERSTICK>: A fingerstick.
  2296. *
  2297. * <c DIDEVTYPEMOUSE_TOUCHPAD>: The device is a touchpad.
  2298. *
  2299. * <c DIDEVTYPEMOUSE_TRACKBALL>: The device is a trackball.
  2300. *
  2301. * For keyboard type devices, the following subtypes are defined:
  2302. *
  2303. * <c DIDEVTYPEKEYBOARD_PCXT>: IBM PC/XT 83-key keyboard.
  2304. *
  2305. * <c DIDEVTYPEKEYBOARD_OLIVETTI>: Olivetti 102-key keyboard.
  2306. *
  2307. * <c DIDEVTYPEKEYBOARD_PCAT>: IBM PC/AT 84-key keyboard.
  2308. *
  2309. * <c DIDEVTYPEKEYBOARD_PCENH>: IBM PC Enhanced 101/102-key
  2310. * or Microsoft Natural keyboard.
  2311. *
  2312. * <c DIDEVTYPEKEYBOARD_NOKIA1050>: Nokia 1050 keyboard.
  2313. *
  2314. * <c DIDEVTYPEKEYBOARD_NOKIA9140>: Nokia 9140 keyboard.
  2315. *
  2316. * <c DIDEVTYPEKEYBOARD_NEC98>: Japanese NEC PC98 keyboard.
  2317. *
  2318. * <c DIDEVTYPEKEYBOARD_NEC98LAPTOP>:
  2319. * Japanese NEC PC98 laptop keyboard.
  2320. *
  2321. * <c DIDEVTYPEKEYBOARD_NEC98106>:
  2322. * Japanese NEC PC98 106-key keyboard.
  2323. *
  2324. * <c DIDEVTYPEKEYBOARD_JAPAN106>: Japanese 106-key keyboard.
  2325. *
  2326. * <c DIDEVTYPEKEYBOARD_JAPANAX>: Japanese AX keyboard.
  2327. *
  2328. * <c DIDEVTYPEKEYBOARD_J3100>: Japanese J3100 keyboard.
  2329. *
  2330. ;begin_public_500
  2331. * For joystick type devices, in DInput versions 5 to 7, the
  2332. * following subtypes are defined:
  2333. *
  2334. * <c DIDEVTYPEJOYSTICK_UNKNOWN>: The subtype could not be
  2335. * determined.
  2336. *
  2337. * <c DIDEVTYPEJOYSTICK_TRADITIONAL>: A traditional joystick.
  2338. *
  2339. * <c DIDEVTYPEJOYSTICK_FLIGHTSTICK>: A joystick optimized for
  2340. * flight simulation.
  2341. *
  2342. * <c DIDEVTYPEJOYSTICK_GAMEPAD>: A joystick whose primary
  2343. * purpose is to provide button input.
  2344. *
  2345. * <c DIDEVTYPEJOYSTICK_RUDDER>: A joystick optimized for
  2346. * yaw control.
  2347. *
  2348. * <c DIDEVTYPEJOYSTICK_WHEEL>: A joystick optimized for
  2349. * use as a steering wheel.
  2350. *
  2351. * <c DIDEVTYPEJOYSTICK_HEADTRACKER>: A joystick designed as a
  2352. * head-mounted tracking device.
  2353. *
  2354. ;end_public_500
  2355. ;begin_public_800
  2356. *
  2357. * DInput 8 device subtypes:
  2358. * For mouse type devices, the following subtypes are defined:
  2359. *
  2360. * <c DI8DEVTYPEMOUSE_UNKNOWN>: The subtype could not be
  2361. * determined.
  2362. *
  2363. * <c DI8DEVTYPEMOUSE_TRADITIONAL>: A traditional mouse.
  2364. *
  2365. * <c DI8DEVTYPEMOUSE_FINGERSTICK>: A fingerstick.
  2366. *
  2367. * <c DI8DEVTYPEMOUSE_TOUCHPAD>: The device is a touchpad.
  2368. *
  2369. * <c DI8DEVTYPEMOUSE_TRACKBALL>: The device is a trackball.
  2370. *
  2371. * <c DI8DEVTYPEMOUSE_ABSOLUTE>: A mouse reporting absolute
  2372. * axis values. (Note, there is no coresponding value in previous
  2373. * versions.)
  2374. *
  2375. * For keyboard type devices, the following subtypes are defined:
  2376. *
  2377. * <c DI8DEVTYPEKEYBOARD_PCXT>: IBM PC/XT 83-key keyboard.
  2378. *
  2379. * <c DI8DEVTYPEKEYBOARD_OLIVETTI>: Olivetti 102-key keyboard.
  2380. *
  2381. * <c DI8DEVTYPEKEYBOARD_PCAT>: IBM PC/AT 84-key keyboard.
  2382. *
  2383. * <c DI8DEVTYPEKEYBOARD_PCENH>: IBM PC Enhanced 101/102-key
  2384. * or Microsoft Natural keyboard.
  2385. *
  2386. * <c DI8DEVTYPEKEYBOARD_NOKIA1050>: Nokia 1050 keyboard.
  2387. *
  2388. * <c DI8DEVTYPEKEYBOARD_NOKIA9140>: Nokia 9140 keyboard.
  2389. *
  2390. * <c DI8DEVTYPEKEYBOARD_NEC98>: Japanese NEC PC98 keyboard.
  2391. *
  2392. * <c DI8DEVTYPEKEYBOARD_NEC98LAPTOP>:
  2393. * Japanese NEC PC98 laptop keyboard.
  2394. *
  2395. * <c DI8DEVTYPEKEYBOARD_NEC98106>:
  2396. * Japanese NEC PC98 106-key keyboard.
  2397. *
  2398. * <c DI8DEVTYPEKEYBOARD_JAPAN106>: Japanese 106-key keyboard.
  2399. *
  2400. * <c DI8DEVTYPEKEYBOARD_JAPANAX>: Japanese AX keyboard.
  2401. *
  2402. * <c DIDEVTYPEKEYBOARD_J3100>: Japanese J3100 keyboard.
  2403. *
  2404. * For joystick type devices, following subtypes are defined:
  2405. *
  2406. * <c DI8DEVTYPEJOYSTICK_LIMITED>: A joystick which does not provide
  2407. * the minimal semantic mapper joystick device capabilities.
  2408. *
  2409. * <c DI8DEVTYPEJOYSTICK_STANDARD>: A joystick which provides at least
  2410. * the minimal semantic mapper joystick device capabilities.
  2411. *
  2412. * For gamepad type devices, following subtypes are defined:
  2413. *
  2414. * <c DI8DEVTYPEGAMEPAD_LIMITED>: A gamepad which does not provide
  2415. * the minimal semantic mapper gamepad device capabilities.
  2416. *
  2417. * <c DI8DEVTYPEGAMEPAD_STANDARD>: A gamepad which provides at least
  2418. * the minimal semantic mapper gamepad device capabilities.
  2419. *
  2420. * <c DI8DEVTYPEGAMEPAD_TILT>: A gamepad which can report X and Y axes
  2421. * based upon roll and pitch of the gamepad.
  2422. *
  2423. *
  2424. * For driving type devices, following subtypes are defined:
  2425. *
  2426. * <c DI8DEVTYPEDRIVING_LIMITED>: A device with a steering wheel that
  2427. * does not have the minimal semantic mapper wheel device capabilities.
  2428. * Note, this device could be a steering wheel and nothing else or it
  2429. * could be one button short of the minimum.
  2430. *
  2431. * <c DI8DEVTYPEDRIVING_COMBINEDPEDALS>: A steering wheel which
  2432. * provides at least the minimal semantic mapper wheel device
  2433. * capabilities including accelleration and brake pedals combined in
  2434. * a single axis.
  2435. *
  2436. * <c DI8DEVTYPEDRIVING_DUALPEDALS>: A steering wheel which provides
  2437. * at least the minimal semantic mapper wheel device capabilities
  2438. * including separate accelleration and brake pedals.
  2439. *
  2440. * <c DI8DEVTYPEDRIVING_THREEPEDALS>: A steering wheel which provides
  2441. * at least the minimal semantic mapper wheel device capabilities
  2442. * including separate accelleration, brake and clutch pedals.
  2443. *
  2444. * <c DI8DEVTYPEDRIVING_HANDHELD>: A hand held steering device which
  2445. * provides at least the minimal semantic mapper wheel device
  2446. * capabilities.
  2447. *
  2448. *
  2449. * For flight type devices, following subtypes are defined:
  2450. *
  2451. * <c DI8DEVTYPEFLIGHT_LIMITED>: A flight device that does not have
  2452. * the minimal semantic mapper flight device capabilities.
  2453. *
  2454. * <c DI8DEVTYPEFLIGHT_STICK>: A flight stick that has at least the
  2455. * minimal semantic mapper flight device capabilities.
  2456. *
  2457. * <c DI8DEVTYPEFLIGHT_YOKE>: A flight yoke that has at least the
  2458. * minimal semantic mapper flight device capabilities.
  2459. *
  2460. * <c DI8DEVTYPEFLIGHT_RC>: A flight device based on a model aircraft
  2461. * remote control that has at least the minimal semantic mapper
  2462. * flight device capabilities.
  2463. *
  2464. *
  2465. * For first person type devices, following subtypes are defined:
  2466. *
  2467. * <c DI8DEVTYPE1STPERSON_LIMITED>: A first person device which does
  2468. * not provide the minimal semantic mapper device capabilities.
  2469. * Note the is no spec for this ;Internal
  2470. *
  2471. * <c DI8DEVTYPE1STPERSON_UNKNOWN>: A device which provides the
  2472. * minimal semantic mapper device capabilities and is known to be
  2473. * suitable for first person control but has not been classified
  2474. * further.
  2475. *
  2476. * <c DI8DEVTYPE1STPERSON_SIXDOF>: A device which provides the
  2477. * minimal semantic mapper device capabilities and has both
  2478. * rotational and translational axes in all three orthogonal planes.
  2479. *
  2480. * <c DI8DEVTYPE1STPERSON_SHOOTER>: A device which provides the
  2481. * minimal semantic mapper device capabilities and has been designed
  2482. * specifically to suit first person shooter games.
  2483. *
  2484. *
  2485. * For screen pointer type devices, following subtypes are defined:
  2486. *
  2487. * <c DI8DEVTYPESCREENPTR_UNKNOWN>: An unknown form of screen pointing
  2488. * device.
  2489. *
  2490. * <c DI8DEVTYPESCREENPTR_LIGHTGUN>: A light gun.
  2491. *
  2492. * <c DI8DEVTYPESCREENPTR_LIGHTPEN>: A light pen.
  2493. *
  2494. * <c DI8DEVTYPESCREENPTR_TOUCH>: A touch screen.
  2495. *
  2496. *
  2497. * For remote control type devices no subtypes are defined except:
  2498. * <c DI8DEVTYPEREMOTE_UNKNOWN>
  2499. *
  2500. *
  2501. * For device control type devices, following subtypes are defined:
  2502. *
  2503. * <c DI8DEVTYPEDEVICECTRL_UNKNOWN>: An unknown form of device control.
  2504. *
  2505. * <c DI8DEVTYPEDEVICECTRL_COMMSSELECTION>: A control used to make
  2506. * communications selections.
  2507. *
  2508. *
  2509. * For supplemental type devices, following subtypes are defined:
  2510. *
  2511. * <c DI8DEVTYPESUPPLEMENTAL_UNKNOWN>: An unknown form of supplemental
  2512. * device. The device objects should be examined to determine what
  2513. * it should be used for.
  2514. *
  2515. * <c DI8DEVTYPESUPPLEMENTAL_2NDHANDCONTROLLER>: A device designed to
  2516. * be used with the player's second (usually left) hand for controls
  2517. * beyond the primary game play actions.
  2518. *
  2519. * <c DI8DEVTYPESUPPLEMENTAL_HEADTRACKER>: A device reporting head
  2520. * motions in terms of yaw, pitch and roll.
  2521. *
  2522. * <c DI8DEVTYPESUPPLEMENTAL_HANDTRACKER>: A device reporting hand
  2523. * motions in terms of yaw, pitch and roll.
  2524. *
  2525. * <c DI8DEVTYPESUPPLEMENTAL_SHIFTSTICKGATE>: A device reporting gear
  2526. * selection of a shift stick using only button states.
  2527. *
  2528. * <c DI8DEVTYPESUPPLEMENTAL_SHIFTER>: A device reporting gear
  2529. * selection of a shift stick using an axis.
  2530. *
  2531. * <c DI8DEVTYPESUPPLEMENTAL_THROTTLE>: A device with the primary
  2532. * function of reporting a single throttle value. Note it may have
  2533. * other controls such as buttons, dials or hat switches.
  2534. *
  2535. * <c DI8DEVTYPESUPPLEMENTAL_SPLITTHROTTLE>: A device with the primary
  2536. * function of reporting at least two throttle values. Note it may
  2537. * have other controls such as buttons, dials or hat switches.
  2538. *
  2539. * <c DI8DEVTYPESUPPLEMENTAL_COMBINEDPEDALS>: A device with the primary
  2540. * function of reporting accelleration and brake pedal values through
  2541. * a single axis. Although unlikely, it may have other controls.
  2542. *
  2543. * <c DI8DEVTYPESUPPLEMENTAL_DUALPEDALS>: A device with the primary
  2544. * function of reporting accelleration and brake pedal values using
  2545. * separate axes. Although unlikely, it may have other controls.
  2546. *
  2547. * <c DI8DEVTYPESUPPLEMENTAL_THREEPEDALS>: A device with the primary
  2548. * function of reporting accelleration, brake and clutch pedal values
  2549. * using separate axes. Although unlikely, it may have other controls.
  2550. *
  2551. * <c DI8DEVTYPESUPPLEMENTAL_RUDDERPEDALS>: A device with the primary
  2552. * function of reporting a rudder pedal value. Although unlikely,
  2553. * it may have other controls.
  2554. *
  2555. ;end_public_800
  2556. ;begin_dx3
  2557. * The high-order word of the device type description code
  2558. * is reserved for future use.
  2559. ;end_dx3
  2560. ;begin_public_500
  2561. * The high-order word of the device type description code
  2562. * contains flags which further identify the device.
  2563. *
  2564. * <c DIDEVTYPE_HID>: The device uses the
  2565. * Human Input Device (HID) protocol.
  2566. ;end_public_500
  2567. *
  2568. * @xref <f GET_DIDEVICE_TYPE>,
  2569. * <f GET_DIDEVICE_SUBTYPE>.
  2570. *
  2571. * @func BYTE | GET_DIDEVICE_TYPE |
  2572. *
  2573. * Extracts the device type code from a
  2574. * device type description code.
  2575. *
  2576. * @parm DWORD | dwDevType |
  2577. *
  2578. * DirectInput device type description code.
  2579. *
  2580. * @xref "DirectInput device type description codes".
  2581. *
  2582. * @func BYTE | GET_DIDEVICE_SUBTYPE |
  2583. *
  2584. * Extracts the device subtype code from a
  2585. * device type description code. Note that the interpretation
  2586. * of the subtype code depends on the device primary type.
  2587. *
  2588. * @parm DWORD | dwDevType |
  2589. *
  2590. * DirectInput device type description code.
  2591. *
  2592. * @xref "DirectInput device type description codes".
  2593. *
  2594. ****************************************************************************/
  2595. enddoc
  2596. #if DIRECTINPUT_VERSION <= 0x700 ;public_800
  2597. #define DIDEVTYPE_DEVICE 1
  2598. #define DIDEVTYPE_MOUSE 2
  2599. #define DIDEVTYPE_KEYBOARD 3
  2600. #define DIDEVTYPE_JOYSTICK 4
  2601. #define DIDEVTYPE_MAX 5 ;internal
  2602. ;begin_public_800
  2603. #else
  2604. #define DI8DEVCLASS_ALL 0
  2605. #define DI8DEVCLASS_DEVICE 1
  2606. #define DI8DEVCLASS_POINTER 2
  2607. #define DI8DEVCLASS_KEYBOARD 3
  2608. #define DI8DEVCLASS_GAMECTRL 4
  2609. #define DI8DEVCLASS_MAX 5 ;internal
  2610. #define DI8DEVTYPE_MIN 0x11 ;internal
  2611. #define DI8DEVTYPE_DEVICE 0x11
  2612. #define DI8DEVTYPE_MOUSE 0x12
  2613. #define DI8DEVTYPE_KEYBOARD 0x13
  2614. #define DI8DEVTYPE_GAMEMIN 0x14 ;internal
  2615. #define DI8DEVTYPE_JOYSTICK 0x14
  2616. #define DI8DEVTYPE_GAMEPAD 0x15
  2617. #define DI8DEVTYPE_DRIVING 0x16
  2618. #define DI8DEVTYPE_FLIGHT 0x17
  2619. #define DI8DEVTYPE_1STPERSON 0x18
  2620. #define DI8DEVTYPE_GAMEMAX 0x19 ;internal
  2621. #define DI8DEVTYPE_DEVICECTRL 0x19
  2622. #define DI8DEVTYPE_SCREENPOINTER 0x1A
  2623. #define DI8DEVTYPE_REMOTE 0x1B
  2624. #define DI8DEVTYPE_SUPPLEMENTAL 0x1C
  2625. #define DI8DEVTYPE_MAX 0x1D ;internal
  2626. #endif /* DIRECTINPUT_VERSION <= 0x700 */
  2627. ;end_public_800
  2628. #define DIDEVTYPE_TYPEMASK 0x000000FF ;internal
  2629. #define DIDEVTYPE_SUBTYPEMASK 0x0000FF00 ;internal
  2630. #define DIDEVTYPE_HID 0x00010000 ;public_500
  2631. #define DIDEVTYPE_ENUMMASK 0xFFFFFF00 ;internal
  2632. #define DIDEVTYPE_ENUMVALID 0x00010000 ;internal
  2633. #define DIDEVTYPE_RANDOM 0x80000000 ;internal
  2634. #if DIRECTINPUT_VERSION <= 0x700 ;public_800
  2635. #define DIDEVTYPEMOUSE_UNKNOWN 1
  2636. #define DIDEVTYPEMOUSE_TRADITIONAL 2
  2637. #define DIDEVTYPEMOUSE_FINGERSTICK 3
  2638. #define DIDEVTYPEMOUSE_TOUCHPAD 4
  2639. #define DIDEVTYPEMOUSE_TRACKBALL 5
  2640. #define DIDEVTYPEKEYBOARD_UNKNOWN 0;public_500
  2641. #define DIDEVTYPEKEYBOARD_PCXT 1
  2642. #define DIDEVTYPEKEYBOARD_OLIVETTI 2
  2643. #define DIDEVTYPEKEYBOARD_PCAT 3
  2644. #define DIDEVTYPEKEYBOARD_PCENH 4
  2645. #define DIDEVTYPEKEYBOARD_NOKIA1050 5
  2646. #define DIDEVTYPEKEYBOARD_NOKIA9140 6
  2647. #define DIDEVTYPEKEYBOARD_NEC98 7
  2648. #define DIDEVTYPEKEYBOARD_NEC98LAPTOP 8
  2649. #define DIDEVTYPEKEYBOARD_NEC98106 9
  2650. #define DIDEVTYPEKEYBOARD_JAPAN106 10
  2651. #define DIDEVTYPEKEYBOARD_JAPANAX 11
  2652. #define DIDEVTYPEKEYBOARD_J3100 12
  2653. ;begin_public_500
  2654. #define DIDEVTYPEJOYSTICK_UNKNOWN 1
  2655. #define DIDEVTYPEJOYSTICK_TRADITIONAL 2
  2656. #define DIDEVTYPEJOYSTICK_FLIGHTSTICK 3
  2657. #define DIDEVTYPEJOYSTICK_GAMEPAD 4
  2658. #define DIDEVTYPEJOYSTICK_RUDDER 5
  2659. #define DIDEVTYPEJOYSTICK_WHEEL 6
  2660. #define DIDEVTYPEJOYSTICK_HEADTRACKER 7
  2661. ;end_public_500
  2662. ;begin_public_800
  2663. #else
  2664. #define DI8DEVTYPEMOUSE_MIN 1;internal
  2665. #define DI8DEVTYPEMOUSE_UNKNOWN 1
  2666. #define DI8DEVTYPEMOUSE_TRADITIONAL 2
  2667. #define DI8DEVTYPEMOUSE_FINGERSTICK 3
  2668. #define DI8DEVTYPEMOUSE_TOUCHPAD 4
  2669. #define DI8DEVTYPEMOUSE_TRACKBALL 5
  2670. #define DI8DEVTYPEMOUSE_ABSOLUTE 6
  2671. #define DI8DEVTYPEMOUSE_MAX 7;internal
  2672. #define DI8DEVTYPEMOUSE_MIN_BUTTONS 0;internal
  2673. #define DI8DEVTYPEMOUSE_MIN_CAPS 0;internal
  2674. #define DI8DEVTYPEKEYBOARD_MIN 0;internal
  2675. #define DI8DEVTYPEKEYBOARD_UNKNOWN 0
  2676. #define DI8DEVTYPEKEYBOARD_PCXT 1
  2677. #define DI8DEVTYPEKEYBOARD_OLIVETTI 2
  2678. #define DI8DEVTYPEKEYBOARD_PCAT 3
  2679. #define DI8DEVTYPEKEYBOARD_PCENH 4
  2680. #define DI8DEVTYPEKEYBOARD_NOKIA1050 5
  2681. #define DI8DEVTYPEKEYBOARD_NOKIA9140 6
  2682. #define DI8DEVTYPEKEYBOARD_NEC98 7
  2683. #define DI8DEVTYPEKEYBOARD_NEC98LAPTOP 8
  2684. #define DI8DEVTYPEKEYBOARD_NEC98106 9
  2685. #define DI8DEVTYPEKEYBOARD_JAPAN106 10
  2686. #define DI8DEVTYPEKEYBOARD_JAPANAX 11
  2687. #define DI8DEVTYPEKEYBOARD_J3100 12
  2688. #define DI8DEVTYPEKEYBOARD_MAX 13;internal
  2689. #define DI8DEVTYPEKEYBOARD_MIN_BUTTONS 0;internal
  2690. #define DI8DEVTYPEKEYBOARD_MIN_CAPS 0;internal
  2691. #define DI8DEVTYPE_LIMITEDGAMESUBTYPE 1
  2692. #define DI8DEVTYPEJOYSTICK_MIN DI8DEVTYPE_LIMITEDGAMESUBTYPE;internal
  2693. #define DI8DEVTYPEJOYSTICK_LIMITED DI8DEVTYPE_LIMITEDGAMESUBTYPE
  2694. #define DI8DEVTYPEJOYSTICK_STANDARD 2
  2695. #define DI8DEVTYPEJOYSTICK_MAX 3;internal
  2696. #define DI8DEVTYPEJOYSTICK_MIN_BUTTONS 5;internal
  2697. #define DI8DEVTYPEJOYSTICK_MIN_CAPS ( JOY_HWS_HASPOV | JOY_HWS_HASZ );internal
  2698. #define DI8DEVTYPEGAMEPAD_MIN DI8DEVTYPE_LIMITEDGAMESUBTYPE;internal
  2699. #define DI8DEVTYPEGAMEPAD_LIMITED DI8DEVTYPE_LIMITEDGAMESUBTYPE
  2700. #define DI8DEVTYPEGAMEPAD_STANDARD 2
  2701. #define DI8DEVTYPEGAMEPAD_TILT 3
  2702. #define DI8DEVTYPEGAMEPAD_MAX 5;internal
  2703. #define DI8DEVTYPEGAMEPAD_MIN_BUTTONS 6;internal
  2704. #define DI8DEVTYPEGAMEPAD_MIN_CAPS 0;internal
  2705. #define DI8DEVTYPEDRIVING_MIN DI8DEVTYPE_LIMITEDGAMESUBTYPE;internal
  2706. #define DI8DEVTYPEDRIVING_LIMITED DI8DEVTYPE_LIMITEDGAMESUBTYPE
  2707. #define DI8DEVTYPEDRIVING_COMBINEDPEDALS 2
  2708. #define DI8DEVTYPEDRIVING_DUALPEDALS 3
  2709. #define DI8DEVTYPEDRIVING_THREEPEDALS 4
  2710. #define DI8DEVTYPEDRIVING_HANDHELD 5
  2711. #define DI8DEVTYPEDRIVING_MAX 6;internal
  2712. #define DI8DEVTYPEDRIVING_MIN_BUTTONS 4;internal
  2713. #define DI8DEVTYPEDRIVING_MIN_CAPS 0;internal
  2714. #define DI8DEVTYPEFLIGHT_MIN DI8DEVTYPE_LIMITEDGAMESUBTYPE;internal
  2715. #define DI8DEVTYPEFLIGHT_LIMITED DI8DEVTYPE_LIMITEDGAMESUBTYPE
  2716. #define DI8DEVTYPEFLIGHT_STICK 2
  2717. #define DI8DEVTYPEFLIGHT_YOKE 3
  2718. #define DI8DEVTYPEFLIGHT_RC 4
  2719. #define DI8DEVTYPEFLIGHT_MAX 5;internal
  2720. #define DI8DEVTYPEFLIGHT_MIN_BUTTONS 4;internal
  2721. #define DI8DEVTYPEFLIGHT_MIN_CAPS ( JOY_HWS_HASPOV | JOY_HWS_HASZ );internal
  2722. #define DI8DEVTYPE1STPERSON_MIN DI8DEVTYPE_LIMITEDGAMESUBTYPE;internal
  2723. #define DI8DEVTYPE1STPERSON_LIMITED DI8DEVTYPE_LIMITEDGAMESUBTYPE
  2724. #define DI8DEVTYPE1STPERSON_UNKNOWN 2
  2725. #define DI8DEVTYPE1STPERSON_SIXDOF 3
  2726. #define DI8DEVTYPE1STPERSON_SHOOTER 4
  2727. #define DI8DEVTYPE1STPERSON_MAX 5;internal
  2728. #define DI8DEVTYPE1STPERSON_MIN_BUTTONS 4;internal
  2729. #define DI8DEVTYPE1STPERSON_MIN_CAPS 0;internal
  2730. #define DI8DEVTYPESCREENPTR_MIN 2;internal
  2731. #define DI8DEVTYPESCREENPTR_UNKNOWN 2
  2732. #define DI8DEVTYPESCREENPTR_LIGHTGUN 3
  2733. #define DI8DEVTYPESCREENPTR_LIGHTPEN 4
  2734. #define DI8DEVTYPESCREENPTR_TOUCH 5
  2735. #define DI8DEVTYPESCREENPTR_MAX 6;internal
  2736. #define DI8DEVTYPESCREENPTR_MIN_BUTTONS 0;internal
  2737. #define DI8DEVTYPESCREENPTR_MIN_CAPS 0;internal
  2738. #define DI8DEVTYPEREMOTE_MIN 2;internal
  2739. #define DI8DEVTYPEREMOTE_UNKNOWN 2
  2740. #define DI8DEVTYPEREMOTE_MAX 3;internal
  2741. #define DI8DEVTYPEREMOTE_MIN_BUTTONS 0;internal
  2742. #define DI8DEVTYPEREMOTE_MIN_CAPS 0;internal
  2743. #define DI8DEVTYPEDEVICECTRL_MIN 2;internal
  2744. #define DI8DEVTYPEDEVICECTRL_UNKNOWN 2
  2745. #define DI8DEVTYPEDEVICECTRL_COMMSSELECTION 3
  2746. #define DI8DEVTYPEDEVICECTRL_COMMSSELECTION_HARDWIRED 4
  2747. #define DI8DEVTYPEDEVICECTRL_MAX 5;internal
  2748. #define DI8DEVTYPEDEVICECTRL_MIN_BUTTONS 0;internal
  2749. #define DI8DEVTYPEDEVICECTRL_MIN_CAPS 0;internal
  2750. #define DI8DEVTYPESUPPLEMENTAL_MIN 2;internal
  2751. #define DI8DEVTYPESUPPLEMENTAL_UNKNOWN 2
  2752. #define DI8DEVTYPESUPPLEMENTAL_2NDHANDCONTROLLER 3
  2753. #define DI8DEVTYPESUPPLEMENTAL_HEADTRACKER 4
  2754. #define DI8DEVTYPESUPPLEMENTAL_HANDTRACKER 5
  2755. #define DI8DEVTYPESUPPLEMENTAL_SHIFTSTICKGATE 6
  2756. #define DI8DEVTYPESUPPLEMENTAL_SHIFTER 7
  2757. #define DI8DEVTYPESUPPLEMENTAL_THROTTLE 8
  2758. #define DI8DEVTYPESUPPLEMENTAL_SPLITTHROTTLE 9
  2759. #define DI8DEVTYPESUPPLEMENTAL_COMBINEDPEDALS 10
  2760. #define DI8DEVTYPESUPPLEMENTAL_DUALPEDALS 11
  2761. #define DI8DEVTYPESUPPLEMENTAL_THREEPEDALS 12
  2762. #define DI8DEVTYPESUPPLEMENTAL_RUDDERPEDALS 13
  2763. #define DI8DEVTYPESUPPLEMENTAL_MAX 14;internal
  2764. #define DI8DEVTYPESUPPLEMENTAL_MIN_BUTTONS 0;internal
  2765. #define DI8DEVTYPESUPPLEMENTAL_MIN_CAPS 0;internal
  2766. #endif /* DIRECTINPUT_VERSION <= 0x700 */
  2767. ;end_public_800
  2768. #define GET_DIDEVICE_TYPE(dwDevType) LOBYTE(dwDevType)
  2769. #define GET_DIDEVICE_SUBTYPE(dwDevType) HIBYTE(dwDevType)
  2770. #define MAKE_DIDEVICE_TYPE(maj, min) MAKEWORD(maj, min) // ;internal
  2771. #define GET_DIDEVICE_TYPEANDSUBTYPE(dwDevType) LOWORD(dwDevType) // ;internal
  2772. begindoc
  2773. /****************************************************************************
  2774. *
  2775. * @doc EXTERNAL |
  2776. *
  2777. * @struct DIDEVCAPS |
  2778. *
  2779. * The <t DIDEVCAPS> structure is used by the
  2780. * <mf IDirectInputDevice::GetCapabilities> method
  2781. * to return the capabilities of the device.
  2782. *
  2783. * @field DWORD | dwSize |
  2784. *
  2785. * (IN) Specifies the size, in bytes, of the structure.
  2786. * This field "must" be initialized by the application
  2787. * before calling <mf IDirectInputDevice::GetCapabilities>.
  2788. *
  2789. * @field DWORD | dwDevType |
  2790. *
  2791. * (OUT) Device type specifier. Se the section titled
  2792. * "DirectInput device type description codes"
  2793. * for a description of this field.
  2794. *
  2795. * @field DWORD | dwFlags |
  2796. *
  2797. * Flags associated with the device. The following flags
  2798. * are defined:
  2799. *
  2800. * <c DIDC_ATTACHED>: The device is physically attached.
  2801. *
  2802. * <c DIDC_POLLEDDEVICE>: At least one object on the device
  2803. * requires polling. Note that HID devices frequently
  2804. * contain a mixture of polled and non-polled objects.
  2805. * For example, a keyboard is almost entirely non-polled,
  2806. * except for the three LEDs for NumLock, CapsLock, and
  2807. * ScrollLock, which must be polled.
  2808. *
  2809. * <y Note>: Do not confuse this flag with
  2810. * the <c DIDC_POLLEDDATAFORMAT> flag. If you want to
  2811. * decide whether polling is necessary to retrieve data
  2812. * in the current data format,
  2813. * check the <c DIDC_POLLEDDATAFORMAT> flag instead.
  2814. * The <c DIDC_POLLEDDEVICE> flag describes the worst-case
  2815. * scenario for the device, not the actual situation.
  2816. *
  2817. * For example, a HID keyboard will be marked as
  2818. * <c DIDC_POLLEDDEVICE> because the LEDs require polling.
  2819. * However, the the standard keyboard data format does not
  2820. * read the LEDs, so <c DIDC_POLLEDDATAFORMAT> will not
  2821. * be set. Polling the device under these conditions is
  2822. * pointless because the data that require polling are
  2823. * inaccessible from the data format anyway.
  2824. *
  2825. * <c DIDC_EMULATED>: Device functionalty is emulated.
  2826. * This flag is new for DirectX 3.0 for Windows NT.
  2827. * This flag is not a reliable indication of efficiency
  2828. * for data collection it only indicates whether or not
  2829. * data is retrieved at kernel mode or user mode.
  2830. *
  2831. *
  2832. * <c DIDC_POLLEDDATAFORMAT>: At least one object in the
  2833. * currently-selected data format requires polling.
  2834. *
  2835. * See the remarks under <c DIDC_POLLEDDEVICE> for a
  2836. * comparison of the two flags.
  2837. *
  2838. * <c DIDC_FORCEFEEDBACK>: The device supports force feedback.
  2839. * This flag is new for DirectX 5.0.
  2840. *
  2841. * <c DIDC_FFFADE>: The force feedback system supports
  2842. * the fade parameter for at least one effect.
  2843. * If the device does not support
  2844. * fade then the fade level and fade time parameters of
  2845. * the <t DIENVELOPE> structure will be ignored by the device.
  2846. *
  2847. * Individual effects will set the <c DIEFT_FFFADE> flag
  2848. * if fade is supported for that particular effect.
  2849. *
  2850. * This flag is new for DirectX 5.0 and applies only to
  2851. * force feedback devices.
  2852. *
  2853. * <c DIDC_FFATTACK>: The force feedback system supports
  2854. * the attack envelope parameter for at least one effect.
  2855. * If the device does not support
  2856. * attack then the attack level and attack time parameters of
  2857. * the <t DIENVELOPE> structure will be ignored by the device.
  2858. *
  2859. * Individual effects will set the <c DIEFT_FFATTACK> flag
  2860. * if attack is supported for that particular effect.
  2861. *
  2862. * This flag is new for DirectX 5.0 and applies only to
  2863. * force feedback devices.
  2864. *
  2865. * <c DIDC_SATURATION>: The force feedback system supports
  2866. * the saturation of condition effects for at least one condition.
  2867. * If the device does not support
  2868. * saturation, then the force generated by a condition
  2869. * is limited only by the maximum force which the device
  2870. * can generate.
  2871. *
  2872. * Individual conditions will set the <c DIEFT_SATURATION> flag
  2873. * if saturation is supported for that particular condition.
  2874. *
  2875. * This flag is new for DirectX 5.0 and applies only to
  2876. * force feedback devices.
  2877. *
  2878. * <c DIDC_POSNEGCOEFFICIENTS>: The force feedback system
  2879. * supports two coefficient values for conditions (one
  2880. * for the positive displacement of the axis and one for
  2881. * the negative displacement of the axis) for at least
  2882. * one condition. If the device
  2883. * does not support both coefficients, then the negative
  2884. * coefficient in the <t DICONDITION> structure will be ignored.
  2885. *
  2886. * Individual conditions will set the
  2887. * <c DIEFT_POSNEGCOEFFICIENTS> flag
  2888. * if separate positive and negative coefficients are
  2889. * are supported for that particular condition.
  2890. *
  2891. * This flag is new for DirectX 5.0 and applies only to
  2892. * force feedback devices.
  2893. *
  2894. * <c DIDC_POSNEGSATURATION>: The force feedback system
  2895. * supports a maximum saturation for both positive and
  2896. * negative force output for at least one condition.
  2897. * If the device does not support
  2898. * both saturation values, then the negative saturation
  2899. * in the <t DICONDITON> structure will be ignored.
  2900. *
  2901. * Individual conditions will set the
  2902. * <c DIEFT_POSNEGSATURATION> flag
  2903. * if separate positive and negative saturations are
  2904. * are supported for that particular condition.
  2905. *
  2906. * This flag is new for DirectX 5.0 and applies only to
  2907. * force feedback devices.
  2908. *
  2909. * <c DIDC_DEADBAND>: The force feedback system
  2910. * supports the dead band parameter
  2911. * for at least one condition. If the device
  2912. * does not support dead bands, then the
  2913. * dead band value in the <t DICONDITION> structure will be ignored.
  2914. *
  2915. * Individual conditions will set the
  2916. * <c DIEFT_DEADBAND> flag
  2917. * if the dead band is supported for that particular condition.
  2918. *
  2919. * This flag is new for DirectX 5.0 and applies only to
  2920. * force feedback devices.
  2921. *
  2922. * Individual conditions will set the
  2923. * <c DIEFT_DEADBAND> flag
  2924. * if the dead band is supported for that particular condition.
  2925. *
  2926. * This flag is new for DirectX 5.0 and applies only to
  2927. * force feedback devices.
  2928. *
  2929. * <c DIDC_STARTDELAY>: The force feedback system
  2930. * supports the start delay parameter
  2931. * for at least one effect. If the device
  2932. * does not support start delays, then the
  2933. * start delay value in the <t DIEFFECT> structure will be ignored.
  2934. *
  2935. * Individual conditions will set the
  2936. * <c DIEFT_STARTDELAY> flag
  2937. * if start delays are supported for that particular effect.
  2938. *
  2939. * This flag is new for DirectX 6.1a and applies only to
  2940. * force feedback devices.
  2941. *
  2942. * <c DIDC_ALIAS>: The device is a duplicate of another
  2943. * DirectInput device.
  2944. * Alias devices are by default not enumerated by
  2945. * <mf IDirectInput::EnumDevices>.
  2946. * Passing the <c DIEDFL_INCLUDEALIASES> flag forces
  2947. * alias devices to be included in the enumeration.
  2948. *
  2949. * This flag is new for DirectX 5.0a.
  2950. *
  2951. * <c DIDC_PHANTOM>: The device does not really exist.
  2952. * It is a placeholder for a device which may exist in the
  2953. * future.
  2954. * Phantom devices are by default not enumerated by
  2955. * <mf IDirectInput::EnumDevices>.
  2956. * Passing the <c DIEDFL_INCLUDEPHANTOMS> flag forces
  2957. * phantom devices to be included in the enumeration.
  2958. *
  2959. * This flag is new for DirectX 5.0a.
  2960. *
  2961. * <c DIDC_HIDDEN>: The device has been hidden from enumeration
  2962. * because it appears to be an alternate version of another
  2963. * device or because using it may cause problems.
  2964. *
  2965. * This flag is new for DirectX 8.
  2966. *
  2967. * @field DWORD | dwAxes |
  2968. *
  2969. * (OUT) Specifies the number of axes available on the device.
  2970. *
  2971. * @field DWORD | dwButtons |
  2972. *
  2973. * Specifies the number of buttons available on the device.
  2974. *
  2975. * @field DWORD | dwPOVs |
  2976. *
  2977. * Specifies the number of point-of-view controllers
  2978. * available on the device.
  2979. *
  2980. * @field DWORD | dwFFSamplePeriod |
  2981. *
  2982. * The minimum time between playback of consecutive
  2983. * raw force commands.
  2984. *
  2985. * This field is new for DirectX 5.0.
  2986. *
  2987. * @field DWORD | dwFFMinTimeResolution |
  2988. *
  2989. * The minimum amount of time, in microseconds,
  2990. * that the device can resolve. The device rounds
  2991. * any times to the nearest supported increment.
  2992. * For example, if the value of
  2993. * <e DIDEVCAPS.dwFFMinTimeResolution> is 1000,
  2994. * then the device would round any times to
  2995. * the nearest millisecond.
  2996. *
  2997. * This field is new for DirectX 5.0.
  2998. *
  2999. * @field DWORD | dwFirmwareRevision |
  3000. *
  3001. * Specifies the firmware revision of the device.
  3002. *
  3003. * This field is new for DirectX 5.0.
  3004. *
  3005. * @field DWORD | dwHardwareRevision |
  3006. *
  3007. * Specifies the hardware revision of the device.
  3008. *
  3009. * This field is new for DirectX 5.0.
  3010. *
  3011. * @field DWORD | dwFFDriverVersion |
  3012. *
  3013. * Specifies the version number of the force feedback
  3014. * device driver.
  3015. *
  3016. * This field is new for DirectX 5.0.
  3017. *
  3018. ****************************************************************************/
  3019. enddoc
  3020. ;begin_if_(DIRECTINPUT_VERSION)_500
  3021. /* This structure is defined for DirectX 3.0 compatibility */
  3022. typedef struct DIDEVCAPS_DX3 {
  3023. DWORD dwSize;
  3024. DWORD dwFlags;
  3025. DWORD dwDevType;
  3026. DWORD dwAxes;
  3027. DWORD dwButtons;
  3028. DWORD dwPOVs;
  3029. } DIDEVCAPS_DX3, *LPDIDEVCAPS_DX3;
  3030. ;end
  3031. typedef struct DIDEVCAPS {
  3032. DWORD dwSize;
  3033. DWORD dwFlags;
  3034. DWORD dwDevType;
  3035. DWORD dwAxes;
  3036. DWORD dwButtons;
  3037. DWORD dwPOVs;
  3038. ;begin_if_(DIRECTINPUT_VERSION)_500
  3039. DWORD dwFFSamplePeriod;
  3040. DWORD dwFFMinTimeResolution;
  3041. DWORD dwFirmwareRevision;
  3042. DWORD dwHardwareRevision;
  3043. DWORD dwFFDriverVersion;
  3044. ;end
  3045. } DIDEVCAPS, *LPDIDEVCAPS;
  3046. ;begin_internal
  3047. /*
  3048. * Name for the 5.0 structure, in places where we specifically care.
  3049. */
  3050. typedef DIDEVCAPS DIDEVCAPS_DX5;
  3051. typedef DIDEVCAPS *LPDIDEVCAPS_DX5;
  3052. BOOL static __inline
  3053. IsValidSizeDIDEVCAPS(DWORD cb)
  3054. {
  3055. return cb == sizeof(DIDEVCAPS_DX5) ||
  3056. cb == sizeof(DIDEVCAPS_DX3);
  3057. }
  3058. ;end_internal
  3059. #define DIDC_ATTACHED 0x00000001
  3060. #define DIDC_POLLEDDEVICE 0x00000002
  3061. #define DIDC_EMULATED 0x00000004
  3062. #define DIDC_POLLEDDATAFORMAT 0x00000008
  3063. ;begin_if_(DIRECTINPUT_VERSION)_500
  3064. /* Force feedback bits live in the high byte, to keep them together */;internal
  3065. #define DIDC_FORCEFEEDBACK 0x00000100
  3066. #define DIDC_FFATTACK 0x00000200
  3067. #define DIDC_FFFADE 0x00000400
  3068. #define DIDC_SATURATION 0x00000800
  3069. #define DIDC_POSNEGCOEFFICIENTS 0x00001000
  3070. #define DIDC_POSNEGSATURATION 0x00002000
  3071. #define DIDC_DEADBAND 0x00004000
  3072. ;end
  3073. #define DIDC_STARTDELAY 0x00008000;public_600
  3074. #define DIDC_FFFLAGS 0x0000FF00;internal
  3075. ;begin_internal
  3076. /*
  3077. * Flags in the upper word mark devices normally excluded from enumeration.
  3078. * To force enumeration of the device, you must pass the appropriate
  3079. * DIEDFL_* flag.
  3080. */
  3081. ;end_internal
  3082. ;begin_if_(DIRECTINPUT_VERSION)_50A
  3083. #define DIDC_ALIAS 0x00010000
  3084. #define DIDC_PHANTOM 0x00020000
  3085. #define DIDC_EXCLUDEMASK 0x00FF0000;internal
  3086. ;end
  3087. ;begin_if_(DIRECTINPUT_VERSION)_800
  3088. #define DIDC_HIDDEN 0x00040000
  3089. ;end
  3090. #define DIDC_RANDOM 0x80000000 //;Internal
  3091. begindoc
  3092. /****************************************************************************
  3093. *
  3094. * @doc EXTERNAL
  3095. *
  3096. * @flags DirectInput Data Format Types |
  3097. *
  3098. * Describe attributes of a single object in a device.
  3099. *
  3100. * @flag DIDFT_ALL |
  3101. *
  3102. * Valid only for <mf IDirectInputDevice::EnumObjects>:
  3103. * Enumerate all objects,
  3104. * regardless of type. This flag may not be combined
  3105. * with any of the other flags.
  3106. *
  3107. * @flag DIDFT_RELAXIS |
  3108. *
  3109. * Object is a relative axis. A relative axis is one
  3110. * which reports its data as incremental
  3111. * changes from the previous reported position.
  3112. *
  3113. * Relative axes typically support an unlimited range.
  3114. *
  3115. * Note that an axis need not report a continuous range
  3116. * of values.
  3117. * The <c DIPROP_GRANULARITY> property of an axis will
  3118. * report the axis granularity.
  3119. *
  3120. * Note that relative axis devices do not have "absolute"
  3121. * coordinates. Rather, the reported "absolute" coordinates
  3122. * are simply the total of all relative coordinates
  3123. * reported by the device while it has been acquired.
  3124. *
  3125. * As a result, the "absolute" coordinates retrieved from
  3126. * a relative-axis object are meaningful only when compared
  3127. * to other "absolute" coordinates. For example, an application
  3128. * may record the "absolute" position of the mouse when a button
  3129. * is pressed, and retrieve it when the button is released.
  3130. * By subtracting the two, the application can compute the
  3131. * distance between the point the button was pressed and the
  3132. * point the button was released.
  3133. *
  3134. * Passing this flag to <mf IDirectInputDevice::EnumObjects>
  3135. * restricts the enumeration to relative axis objects.
  3136. *
  3137. * @flag DIDFT_ABSAXIS |
  3138. *
  3139. * Object is an absolute axis. An absolute axis is one
  3140. * reports data as absolute positions.
  3141. *
  3142. * Absolute axes typically support a finite range.
  3143. *
  3144. * Note that an axis need not report a continuous range
  3145. * of values.
  3146. * The <c DIPROP_GRANULARITY> property of an axis will
  3147. * report the axis granularity.
  3148. *
  3149. * Passing this flag to <mf IDirectInputDevice::EnumObjects>
  3150. * restricts the enumeration to absolute axis objects.
  3151. *
  3152. * @flag DIDFT_AXIS |
  3153. *
  3154. * Valid only for <mf IDirectInputDevice::EnumObjects>:
  3155. * Object is either an
  3156. * absolute axis or a relative axis.
  3157. *
  3158. * Passing this flag to <mf IDirectInputDevice::EnumObjects>
  3159. * restricts the enumeration to axis objects.
  3160. *
  3161. * @flag DIDFT_PSHBUTTON |
  3162. *
  3163. * Object is a pushbutton. A pushbutton is reported as
  3164. * down when the user presses it and as up when the user
  3165. * releases it.
  3166. *
  3167. * Passing this flag to <mf IDirectInputDevice::EnumObjects>
  3168. * restricts the enumeration to push-button objects.
  3169. *
  3170. * @flag DIDFT_TGLBUTTON |
  3171. *
  3172. * Object is a toggle button. A toggle button is reported as
  3173. * down when the user presses it and remains reported as down
  3174. * until the user presses the button a second time.
  3175. * Note that in some cases when a toggle button is held down
  3176. * it may be reported as changing state repeatedly.
  3177. *
  3178. * Passing this flag to <mf IDirectInputDevice::EnumObjects>
  3179. * restricts the enumeration to toggle-button objects.
  3180. *
  3181. * @flag DIDFT_BUTTON |
  3182. *
  3183. * Object is a either a pushbutton or toggle button.
  3184. *
  3185. * Passing this flag to <mf IDirectInputDevice::EnumObjects>
  3186. * restricts the enumeration to button objects.
  3187. *
  3188. * @flag DIDFT_POV |
  3189. *
  3190. * Object is a point-of-view controller.
  3191. * A point-of-view controller reports either the direction the user
  3192. * is pressing the controller (in thousandths of degrees clockwise
  3193. * from north), or the special value <c JOY_POVCENTERED>
  3194. * to indicate that no direction is being indicated.
  3195. * The <c JOY_POV*> values are defined in the mmsystem.h
  3196. * header file.
  3197. *
  3198. * Note that a point-of-view controller need not report a
  3199. * continuous range of values. (In fact, most currently do not.)
  3200. * The <c DIPROP_GRANULARITY> property of a point-of-view
  3201. * controller will report the indicator granularity.
  3202. *
  3203. * Passing this flag to <mf IDirectInputDevice::EnumObjects>
  3204. * restricts the enumeration to POV objects.
  3205. *
  3206. * This type is new for DirectX 5.0.
  3207. *
  3208. * @flag DIDFT_COLLECTION |
  3209. *
  3210. * Object is a HID link collection and does not
  3211. * generate data of its own. If a HID link collection
  3212. * is enumerated, you can extract the link collection
  3213. * number with the <f DIDFT_GETINSTANCE> macro.
  3214. * You can then pass the link collection number to
  3215. * the <mf IDirectInputDevice2::EnumObjects>
  3216. * method with the
  3217. * <c DIDFT_ENUMCOLLECTION(n)> flag
  3218. * to enumerate the objects in collection <c n>,
  3219. * or you can pass the link collection number
  3220. * to functions in the HID parsing library (hidpi.h)
  3221. * to obtain additional information.
  3222. *
  3223. * Passing this flag to <mf IDirectInputDevice::EnumObjects>
  3224. * restricts the enumeration to HID link collections.
  3225. *
  3226. * This type is new for DirectX 5.0.
  3227. *
  3228. * @flag DIDFT_NODATA |
  3229. *
  3230. * Object does not generate data. Although no data
  3231. * can be read from a "no data" object, the object
  3232. * can be used as an output actuator in a force
  3233. * feedback effect (if the <c DIDFT_FFACTUATOR> flag
  3234. * is set), or it can be used as a target of
  3235. * <mf IDirectInputDevice2::SendDeviceData> (if
  3236. * the <c DIDFT_OUTPUT> flag is set).
  3237. *
  3238. * If the <c DIDFT_NODATA> flag is set, then the value
  3239. * of the <e DIDEVICEOBJECTINSTANCE.dwOfs> field in the
  3240. * <t DIDEVICEOBJECTINSTANCE> structure is meaningless
  3241. * and should be ignored.
  3242. *
  3243. * Passing this flag to <mf IDirectInputDevice::EnumObjects>
  3244. * restricts the enumeration to objects that do not generate
  3245. * data.
  3246. *
  3247. * This type is new for DirectX 5.0.
  3248. *
  3249. * @flag DIDFT_FFACTUATOR |
  3250. *
  3251. * Object contains a force feedback actuator.
  3252. * In other words, forces may be applied to this object.
  3253. *
  3254. * Passing this flag to
  3255. * <mf IDirectInputDevice::EnumObjects>
  3256. * restricts enumeration to objects which
  3257. * support force feedback.
  3258. *
  3259. * Passing this flag to <mf IDirectInputDevice::EnumObjects>
  3260. * restricts the enumeration to objects which support a
  3261. * force feedback actuator.
  3262. *
  3263. * This flag is new for DirectX 5.0.
  3264. *
  3265. * @flag DIDFT_FFEFFECTTRIGGER |
  3266. *
  3267. * Object may be used to trigger force feedback effects.
  3268. *
  3269. * Passing this flag to
  3270. * <mf IDirectInputDevice::EnumObjects>
  3271. * restricts enumeration to objects which
  3272. * can be used to trigger force feedback effects.
  3273. *
  3274. * Passing this flag to <mf IDirectInputDevice::EnumObjects>
  3275. * restricts the enumeration to objects which can be used
  3276. * as force feedback triggers.
  3277. *
  3278. * This flag is new for DirectX 5.0.
  3279. *
  3280. * @flag DIDFT_OUTPUT |
  3281. *
  3282. * Object can be sent data with the
  3283. * <mf IDirectInputDevice2::SendDeviceData> method.
  3284. *
  3285. * Passing this flag to
  3286. * <mf IDirectInputDevice::EnumObjects>
  3287. * restricts enumeration to objects which
  3288. * can be sent data.
  3289. *
  3290. * This flag is new for DirectX 5.0a.
  3291. *
  3292. * @flag DIDFT_NOCOLLECTION |
  3293. *
  3294. * Special parameter to <mf IDirectInputDevice::EnumObjects>
  3295. * which restricts the enumeration to objects that do not
  3296. * belong to any HID link collection.
  3297. *
  3298. * @flag DIDFT_ALIAS |
  3299. *
  3300. * Some objects may have aliases ( muliple names for the same object ).
  3301. * By default, Dinput will only expose the primary usage for an object.
  3302. *
  3303. * Passing this flag to
  3304. * <mf IDirectInputDevice::EnumObjects>
  3305. * <f enables> alias to be enumurated. All aliases for an object will have the
  3306. * same offset and object instance.
  3307. *
  3308. * @flag DIDFT_VENDORDEFINED |
  3309. *
  3310. * A device may have objects that are vendor specific. (For example: a mode button that
  3311. * changes device characteristics.) By default, Dinput will only expose non vendor
  3312. * specific device objects.
  3313. *
  3314. * Passing this flag to
  3315. * <mf IDirectInputDevice::EnumObjects>
  3316. * <f enables> vendor specific device objects to be enumurated.
  3317. *
  3318. *
  3319. * @xref <f DIDFT_GETTYPE>, <f DIDFT_GETINSTANCE>,
  3320. * <f DIDFT_ENUMCOLLECTION>.
  3321. *
  3322. ****************************************************************************/
  3323. /*
  3324. * @func BYTE | DIDFT_GETTYPE |
  3325. *
  3326. * Extracts the object type code from a data format type.
  3327. *
  3328. * @parm DWORD | dwType |
  3329. *
  3330. * DirectInput data format type.
  3331. *
  3332. * @xref "DirectInput Data Format Types".
  3333. *
  3334. * @func BYTE | DIDFT_GETINSTANCE |
  3335. *
  3336. * Extracts the object instance number code from a data format type.
  3337. *
  3338. * @parm DWORD | dwType |
  3339. *
  3340. * DirectInput data format type.
  3341. *
  3342. * @func DWORD | DIDFT_ENUMCOLLECTION |
  3343. *
  3344. * Special parameter to <mf IDirectInputDevice::EnumObjects>
  3345. * which restricts the enumeration to objects within the
  3346. * specified HID link collection. By default, objects are
  3347. * enumerated regardless of the link collection number.
  3348. *
  3349. * @parm WORD | wCollectionNumber |
  3350. *
  3351. * HID link collection to which enumeration is to be restricted.
  3352. *
  3353. * @xref "DirectInput Data Format Types".
  3354. *
  3355. ****************************************************************************/
  3356. /*
  3357. * Warning! These values must be in sync with the values in diloc.inc
  3358. *
  3359. ****************************************************************************/
  3360. enddoc
  3361. #define DIDFT_ALL 0x00000000
  3362. #define DIDFT_RELAXIS 0x00000001
  3363. #define DIDFT_ABSAXIS 0x00000002
  3364. #define DIDFT_AXIS 0x00000003
  3365. #define DIDFT_PSHBUTTON 0x00000004
  3366. #define DIDFT_TGLBUTTON 0x00000008
  3367. #define DIDFT_BUTTON 0x0000000C
  3368. #define DIDFT_POV 0x00000010
  3369. #define DIDFT_RESERVEDTYPES 0x00000020 // ;Internal - new types go here
  3370. #define DIDFT_COLLECTION 0x00000040
  3371. #define DIDFT_NODATA 0x00000080
  3372. // ;Internal
  3373. #define DIDFT_DWORDOBJS 0x00000013 // ;Internal
  3374. #define DIDFT_BYTEOBJS 0x0000000C // ;Internal
  3375. #define DIDFT_CONTROLOBJS 0x0000001F // ;Internal
  3376. #define DIDFT_ALLOBJS 0x0000001F // ;Internal_dx3
  3377. #define DIDFT_ALLOBJS_DX3 0x0000001F // ;Internal_500
  3378. #define DIDFT_ALLOBJS 0x000000DF // ;Internal_500
  3379. #define DIDFT_TYPEMASK 0x000000FF ;internal
  3380. #define DIDFT_TYPEVALID DIDFT_TYPEMASK // ;Internal
  3381. #define DIDFT_ANYINSTANCE 0x0000FF00;public_dx3
  3382. #define DIDFT_ANYINSTANCE 0x00FFFF00;public_500
  3383. #define DIDFT_INSTANCEMASK DIDFT_ANYINSTANCE
  3384. #define DIDFT_MAKEINSTANCE(n) ((BYTE)(n) << 8);public_dx3
  3385. #define DIDFT_MAKEINSTANCE(n) ((WORD)(n) << 8);public_500
  3386. #define DIDFT_GETTYPE(n) LOBYTE(n)
  3387. #define DIDFT_GETINSTANCE(n) HIBYTE(n);public_dx3
  3388. #define DIDFT_GETINSTANCE(n) LOWORD((n) >> 8);public_500
  3389. #define DIDFT_FINDMASK 0x00FFFFFF // ;Internal
  3390. #define DIDFT_FINDMATCH(n,m) ((((n)^(m)) & DIDFT_FINDMASK) == 0) ;internal
  3391. ;internal
  3392. #define DIDFT_FFACTUATOR 0x01000000
  3393. #define DIDFT_FFEFFECTTRIGGER 0x02000000
  3394. ;begin_if_(DIRECTINPUT_VERSION)_50A
  3395. #define DIDFT_OUTPUT 0x10000000
  3396. #define DIDFT_VENDORDEFINED 0x04000000
  3397. #define DIDFT_ALIAS 0x08000000
  3398. ;end
  3399. // ;Internal
  3400. /* // ;Internal
  3401. * DIDFT_OPTIONAL means that the // ;Internal
  3402. * SetDataFormat should ignore the // ;Internal
  3403. * field if the device does not // ;Internal
  3404. * support the object. // ;Internal
  3405. */ // ;Internal
  3406. #define DIDFT_OPTIONAL 0x80000000 // ;Internal
  3407. #define DIDFT_BESTFIT 0x40000000 // ;Internal
  3408. #define DIDFT_RANDOM 0x20000000 // ;Internal
  3409. #define DIDFT_ATTRVALID 0x1f000000 ;internal_50A
  3410. #if 0 // Disable the next line if building 5a ;internal_50A
  3411. #define DIDFT_ATTRVALID 0x07000000 ;internal_dx5
  3412. #endif ;internal_50A
  3413. #define DIDFT_ATTRMASK 0xFF000000 ;internal
  3414. #define DIDFT_ALIASATTRMASK 0x0C000000 ;internal
  3415. #define DIDFT_GETATTR(n) ((DWORD)(n) >> 24) ;internal
  3416. #define DIDFT_MAKEATTR(n) ((BYTE)(n) << 24) ;internal
  3417. #define DIDFT_ENUMCOLLECTION(n) ((WORD)(n) << 8);public_500
  3418. #define DIDFT_NOCOLLECTION 0x00FFFF00 ;public_500
  3419. #define DIDFT_GETCOLLECTION(n) LOWORD((n) >> 8);internal_500
  3420. #define DIDFT_ENUMVALID 0x0000000F // ;Internal_dx3
  3421. #define DIDFT_ENUMVALID \;Internal_500
  3422. (DIDFT_ATTRVALID | DIDFT_ANYINSTANCE | DIDFT_ALLOBJS);Internal_500
  3423. #ifndef DIJ_RINGZERO
  3424. begindoc
  3425. /****************************************************************************
  3426. *
  3427. * @doc EXTERNAL
  3428. *
  3429. * @struct DIOBJECTDATAFORMAT |
  3430. *
  3431. * The <t DIOBJECTDATAFORMAT> structure is used by the
  3432. * <mf IDirectInputDevice::SetDataFormat> method
  3433. * to set the data format for a single object within
  3434. * a device.
  3435. *
  3436. * @field const GUID * | pguid |
  3437. *
  3438. * The identifier for the axis, button, or other input
  3439. * source. When requesting a data format, leaving this field
  3440. * NULL indicates that any type of object is permissible.
  3441. *
  3442. * If the <c DIDOI_GUIDISUSAGE> flag is set in the
  3443. * <e DIOBJECTDATAFORMAT.dwFlags> field, then this field
  3444. * is really a
  3445. * (suitably cast)
  3446. * <c DIMAKEUSAGEDWORD> of the usage page and usage
  3447. * that is desired.
  3448. *
  3449. * @field DWORD | dwOfs |
  3450. *
  3451. * Offset within the data packet where the data for the
  3452. * input source will be stored. This value must be a
  3453. * multiple of 4 for axes and POVs.
  3454. *
  3455. * @field DWORD | dwType |
  3456. *
  3457. * Specifies the type of object. When requesting a data format,
  3458. * the instance portion can be set to <c DIDFT_ANYINSTANCE>
  3459. * to indicate that any instance is permissible.
  3460. *
  3461. * @field DWORD | dwFlags |
  3462. *
  3463. * Zero or more of the following flags:
  3464. *
  3465. * An optional <c DIDOI_ASPECT*> flag. Multiple aspect flags
  3466. * cannot be combined.
  3467. *
  3468. * The flag <c DIDOI_GUIDISUSAGE>, indicating that the
  3469. * <e DIOBJECTDATAFORMAT.pguid> field is really a
  3470. * (suitably cast)
  3471. * <c DIMAKEUSAGEDWORD> of the usage page and usage
  3472. * that is desired.
  3473. *
  3474. * @ex The following object data format specifies that DirectInput
  3475. * should choose the first available axis and report its value
  3476. * in the DWORD at offset 4 in the device data.
  3477. *
  3478. * |
  3479. *
  3480. * DIOBJECTDATAFORMAT dfAnyAxis = {
  3481. * 0, // Wildcard
  3482. * 4, // Offset
  3483. * DIDFT_AXIS | DIDFT_ANYINSTANCE, // Any axis is okay
  3484. * 0, // No special flags
  3485. * };
  3486. *
  3487. *
  3488. * @ex The following object data format specifies that the X axis
  3489. * of the device should be stored in the DWORD at offset 12 in the
  3490. * device data. If the device has more than one X axis,
  3491. * the first available one should be selected.
  3492. *
  3493. * |
  3494. *
  3495. * DIOBJECTDATAFORMAT dfAnyXAxis = {
  3496. * &GUID_XAxis, // Must be an X axis
  3497. * 12, // Offset
  3498. * DIDFT_AXIS | DIDFT_ANYINSTANCE, // Any X axis is okay
  3499. * 0, // No special flags
  3500. * };
  3501. *
  3502. * @ex The following object data format specifies that DirectInput
  3503. * should choose the first available button and report its value
  3504. * in the high bit of the BYTE at offset 16 in the device data.
  3505. *
  3506. * |
  3507. *
  3508. * DIOBJECTDATAFORMAT dfAnyButton = {
  3509. * 0, // Wildcard
  3510. * 16, // Offset
  3511. * DIDFT_BUTTON | DIDFT_ANYINSTANCE, // Any button is okay
  3512. * 0, // No special flags
  3513. * };
  3514. *
  3515. * @ex The following object data format specifies that DirectInput
  3516. * should choose the first available "Fire" button and report
  3517. * its value in the high bit of the BYTE
  3518. * at offset 17 in the device data.
  3519. *
  3520. * If the device does not have a "Fire" button, the attempt to
  3521. * set this data format will fail.
  3522. *
  3523. * |
  3524. *
  3525. * DIOBJECTDATAFORMAT dfAnyButton = {
  3526. * &GUID_FireButton, // Object type
  3527. * 17, // Offset
  3528. * DIDFT_BUTTON | DIDFT_ANYINSTANCE, // Any button is okay
  3529. * 0, // No special flags
  3530. * };
  3531. *
  3532. * @ex The following object data format specifies that button zero
  3533. * of the device should be reported as the high bit of the
  3534. * BYTE stored at offset 18 in the device data.
  3535. *
  3536. * If the device does not have a button zero, the attempt to
  3537. * set this data format will fail.
  3538. *
  3539. * |
  3540. *
  3541. * DIOBJECTDATAFORMAT dfButton0 = {
  3542. * 0, // Wildcard
  3543. * 18, // Offset
  3544. * DIDFT_BUTTON | DIDFT_MAKEINSTANCE(0), // Button zero
  3545. * 0, // No special flags
  3546. * };
  3547. *
  3548. ****************************************************************************/
  3549. /*
  3550. * Warning! These values must be in sync with the values in diloc.inc
  3551. *
  3552. * Note: pguid cannot be a REFGUID because it may be NULL.
  3553. *
  3554. ****************************************************************************/
  3555. enddoc
  3556. typedef struct _DIOBJECTDATAFORMAT {
  3557. const GUID *pguid;
  3558. DWORD dwOfs;
  3559. DWORD dwType;
  3560. DWORD dwFlags;
  3561. } DIOBJECTDATAFORMAT, *LPDIOBJECTDATAFORMAT;
  3562. typedef const DIOBJECTDATAFORMAT *LPCDIOBJECTDATAFORMAT;
  3563. begindoc
  3564. /****************************************************************************
  3565. *
  3566. * @doc EXTERNAL
  3567. *
  3568. * @struct DIDATAFORMAT |
  3569. *
  3570. * The <t DIDATAFORMAT> structure is used by the
  3571. * <mf IDirectInputDevice::SetDataFormat> method
  3572. * to set the data format for a device.
  3573. * a device.
  3574. *
  3575. * @field DWORD | dwSize |
  3576. *
  3577. * The size of the <t DIDATAFORMAT> structure.
  3578. *
  3579. * @field DWORD | dwObjSize |
  3580. *
  3581. * The size of the <t DIOBJECTDATAFORMAT> structure.
  3582. *
  3583. * @field DWORD | dwFlags |
  3584. *
  3585. * Flags describing other attributes of the data format.
  3586. *
  3587. * The following flags are defined:
  3588. *
  3589. * <c DIDF_RELAXIS>: Set the axes into relative mode.
  3590. * Setting this flag in the data format is equivalent to
  3591. * manually setting the axis mode property via
  3592. * <mf IDirectInputDevice::SetProperty>.
  3593. * The flag may not be combined with <c DIDF_ABSAXIS>.
  3594. *
  3595. * <c DIDF_ABSAXIS>: Set the axes into absolute mode.
  3596. * Setting this flag in the data format is equivalent to
  3597. * manually setting the axis mode property via
  3598. * <mf IDirectInputDevice::SetProperty>.
  3599. * The flag may not be combined with <c DIDF_RELAXIS>.
  3600. *
  3601. * @field DWORD | dwDataSize |
  3602. *
  3603. * The size of the device data that should be returned by
  3604. * the device. This value must be a multiple of four
  3605. * and must exceed the <e DIDATAFORMAT.dwOfs> value for
  3606. * all objects specified in the object list.
  3607. *
  3608. * @field DWORD | dwNumObjs |
  3609. *
  3610. * The number of objects in the <e DIOBJECTDATAFORMAT.rgdf>
  3611. * array.
  3612. *
  3613. * @field LPDIOBJECTDATAFORMAT | rgodf |
  3614. *
  3615. * Pointer to an array of <t DIOBJECTDATAFORMAT> structures,
  3616. * each of which describes how one object's data should be
  3617. * reported in the device data.
  3618. *
  3619. * @comm
  3620. * "It is an error" for the <p rgdf> to indicate that two
  3621. * difference pieces of information be placed in the same
  3622. * location.
  3623. *
  3624. * "It is an error" for the <p rgdf> to indicate that the
  3625. * same piece of information be placed in two locations.
  3626. *
  3627. *
  3628. * @ex The following declarations set a data format which can
  3629. * be used for an application which is interested in two
  3630. * axes (reported in absolute coordinates) and two buttons.
  3631. *
  3632. * |
  3633. *
  3634. *
  3635. * // Suppose an application wishes to use the following
  3636. * // structure to read device data.
  3637. *
  3638. * typedef struct MYDATA {
  3639. * LONG lX; // X axis goes here
  3640. * LONG lY; // Y axis goes here
  3641. * BYTE bButtonA; // One button goes here
  3642. * BYTE bButtonB; // Another button goes here
  3643. * BYTE bPadding[2]; // Must be dword multiple in size
  3644. * } MYDATA;
  3645. *
  3646. * // Then it can use the following data format.
  3647. *
  3648. * DIOBJECTDATAFORMAT rgodf[] = {
  3649. * { &GUID_XAxis, FIELD_OFFSET(MYDATA, lX), DIDFT_AXIS | DIDFT_ANYINSTANCE, 0, },
  3650. * { &GUID_YAxis, FIELD_OFFSET(MYDATA, lY), DIDFT_AXIS | DIDFT_ANYINSTANCE, 0, },
  3651. * { &GUID_Button, FIELD_OFFSET(MYDATA, bButtonA), DIDFT_BUTTON | DIDFT_ANYINSTANCE, 0, },
  3652. * { &GUID_Button, FIELD_OFFSET(MYDATA, bButtonB), DIDFT_BUTTON | DIDFT_ANYINSTANCE, 0, },
  3653. * };
  3654. * #define numObjects (sizeof(rgodf) / sizeof(rgodf[0]))
  3655. *
  3656. * DIDATAFORMAT df = {
  3657. * sizeof(DIDATAFORMAT), // this structure
  3658. * sizeof(DIOBJECTDATAFORMAT), // size of object data format
  3659. * DIDF_ABSAXIS, // absolute axis coordinates
  3660. * sizeof(MYDATA), // device data size
  3661. * numObjects, // number of objects
  3662. * rgodf, // and here they are
  3663. * };
  3664. *
  3665. ****************************************************************************/
  3666. enddoc
  3667. typedef struct _DIDATAFORMAT {
  3668. DWORD dwSize;
  3669. DWORD dwObjSize;
  3670. DWORD dwFlags;
  3671. DWORD dwDataSize;
  3672. DWORD dwNumObjs;
  3673. LPDIOBJECTDATAFORMAT rgodf;
  3674. } DIDATAFORMAT, *LPDIDATAFORMAT;
  3675. typedef const DIDATAFORMAT *LPCDIDATAFORMAT;
  3676. #define DIDF_ABSAXIS 0x00000001
  3677. #define DIDF_RELAXIS 0x00000002
  3678. #define DIDF_VALID 0x00000003 //;Internal
  3679. begindoc
  3680. /****************************************************************************
  3681. *
  3682. * @doc EXTERNAL
  3683. *
  3684. * @global DIDATAFORMAT | c_dfDIMouse |
  3685. *
  3686. * A predefined <t DIDATAFORMAT> structure which describes a
  3687. * mouse device. This structure is provided in the
  3688. * DINPUT.LIB library file as a convenience.
  3689. *
  3690. ****************************************************************************/
  3691. enddoc
  3692. #ifdef __cplusplus
  3693. extern "C" {
  3694. #endif
  3695. extern const DIDATAFORMAT c_dfDIMouse;
  3696. ;begin_if_(DIRECTINPUT_VERSION)_700
  3697. extern const DIDATAFORMAT c_dfDIMouse2;
  3698. ;end
  3699. extern const DIDATAFORMAT c_dfDIKeyboard;
  3700. ;begin_if_(DIRECTINPUT_VERSION)_500
  3701. extern const DIDATAFORMAT c_dfDIJoystick;
  3702. extern const DIDATAFORMAT c_dfDIJoystick2;
  3703. ;end
  3704. #ifdef __cplusplus
  3705. };
  3706. #endif
  3707. ;begin_public_800
  3708. #if DIRECTINPUT_VERSION > 0x0700
  3709. begindoc
  3710. /****************************************************************************
  3711. *
  3712. * @doc EXTERNAL
  3713. *
  3714. * @struct DIACTION |
  3715. *
  3716. * The <t DIACTION> structure allows an application to refer
  3717. * to a virtualized device and a controler. The
  3718. *
  3719. * The <t DIACTION> structure is used by:
  3720. * <mf IDirectInput::EnumDevicesBySemantics> to examine the
  3721. * input requirements and enumerate suitable devices.
  3722. * <mf IDirectInputDevice::BuildActionMap> to resolve the vitual
  3723. * device controls to physical device controls.
  3724. * <mf IDirectInputDevice::SetActionMap> to set
  3725. * to set the data format for a single object within
  3726. * a device.
  3727. *
  3728. * @field UINT_PTR | uAppData |
  3729. *
  3730. * An application can specify a <t UINT_PTR> to assign to the to
  3731. * the action. The uAppData will be returned to the application in
  3732. * <mf IDirectInputDevice::GetDeviceState> when the state of the
  3733. * control associated with the action changes.
  3734. *
  3735. * @field DWORD | dwSemantic |
  3736. *
  3737. * One of the predefined semantics for this application genre.
  3738. *
  3739. * @field DWORD | dwFlags |
  3740. *
  3741. * Optional <c DIA_*> flags used to request specific attributes
  3742. * or processing such as force feedback capabilities or application
  3743. * mapped actions.
  3744. *
  3745. * @field OPTIONAL LPCTSTR | lptszActionName |
  3746. *
  3747. * The friendly name associated with the action. This field will be
  3748. * the input config UI in order to display the action to control
  3749. * relations.
  3750. *
  3751. * @field OPTIONAL DWORD | uResIdString |
  3752. *
  3753. * The resource ID for the string for this action within the
  3754. * module hInstString.
  3755. *
  3756. * @field OPTIONAL GUID | guidInstance |
  3757. *
  3758. * The device instance GUID if a specific device is requested.
  3759. * Usually set to a NULL GUID by the application.
  3760. *
  3761. * @field OPTIONAL DWORD | dwObjID |
  3762. *
  3763. * Object type identifier. See <e DIDEVICEOBJECTINSTANCE.dwType>
  3764. * for more details. This allows an application to bypass
  3765. * DirectInput semantic mapping on a per control basis.
  3766. * This element is ignored for <mf IDirectInputDevice::BuildActionMap>
  3767. * and <mf IDirectInputDevice::SetActionMap> unless the
  3768. * <c DIA_APPMAPPED> flag is set in <e DIACTION.dwFlags>.
  3769. *
  3770. * @field OPTIONAL DWORD | dwHow |
  3771. *
  3772. * On input indicates an existing mapping. On output (if changed)
  3773. * indicates the actual mapping mechanism used by DirectInput in
  3774. * order to configure the action.
  3775. *
  3776. ****************************************************************************/
  3777. enddoc
  3778. typedef struct _DIACTION% {
  3779. UINT_PTR uAppData;
  3780. DWORD dwSemantic;
  3781. OPTIONAL DWORD dwFlags;
  3782. OPTIONAL union {
  3783. LPCTSTR% lptszActionName;
  3784. UINT uResIdString;
  3785. };
  3786. OPTIONAL GUID guidInstance;
  3787. OPTIONAL DWORD dwObjID;
  3788. OPTIONAL DWORD dwHow;
  3789. } DIACTION%, *LPDIACTION% ;
  3790. typedef const DIACTION% *LPCDIACTION%;
  3791. typedef const DIACTION *LPCDIACTION;
  3792. begindoc
  3793. /****************************************************************************
  3794. *
  3795. * @doc EXTERNAL
  3796. *
  3797. * @flags DirectInput <e DIACTION.dwFlags> |
  3798. *
  3799. * @flag DIA_FORCEFEEDBACK |
  3800. *
  3801. * The action must be an actuator or trigger.
  3802. *
  3803. * @flag DIA_APPMAPPED |
  3804. *
  3805. * Application has set the dwObjID parameter.
  3806. *
  3807. * @flag DIA_APPNOMAP |
  3808. *
  3809. * Application does not want this action to be mapped.
  3810. *
  3811. * @flag DIA_NORANGE |
  3812. *
  3813. * Application does not want the default range set for this action.
  3814. * This flag currently only applies to axis actions. For other
  3815. * actions it should be set to zero,
  3816. *
  3817. * @flag DIA_APPFIXED |
  3818. *
  3819. * The application does not want this action to be reconfigurable
  3820. * through the default user interface.
  3821. *
  3822. ****************************************************************************/
  3823. enddoc
  3824. #define DIA_FORCEFEEDBACK 0x00000001
  3825. #define DIA_APPMAPPED 0x00000002
  3826. #define DIA_APPNOMAP 0x00000004
  3827. #define DIA_NORANGE 0x00000008
  3828. #define DIA_APPFIXED 0x00000010
  3829. #define DIA_VALID 0x0000001F ;internal_800
  3830. begindoc
  3831. /****************************************************************************
  3832. *
  3833. * @doc EXTERNAL
  3834. *
  3835. * @flags DirectInput <e DIACTION.dwHow> |
  3836. *
  3837. * @flag DIAH_UNMAPPED |
  3838. *
  3839. * The action is not mapped to any control.
  3840. *
  3841. * @flag DIAH_USERCONFIG |
  3842. *
  3843. * The user has specified this action to control mapping.
  3844. *
  3845. * @flag DIAH_APPREQUESTED |
  3846. *
  3847. * Application specified action to control map.
  3848. *
  3849. * @flag DIAH_HWAPP |
  3850. *
  3851. * The hardware vendor has suggested this action for this
  3852. * application.
  3853. *
  3854. * @flag DIAH_HWDEFAULT |
  3855. *
  3856. * The hardware vendor has suggested this action for the same
  3857. * semantic in similar applications.
  3858. *
  3859. * @flag DIAH_ERROR |
  3860. *
  3861. * An error was found in processing this action.
  3862. *
  3863. * @flag DIAH_DEFAULT |
  3864. *
  3865. * None of the above.
  3866. *
  3867. ****************************************************************************/
  3868. enddoc
  3869. #define DIAH_UNMAPPED 0x00000000
  3870. #define DIAH_USERCONFIG 0x00000001
  3871. #define DIAH_APPREQUESTED 0x00000002
  3872. #define DIAH_HWAPP 0x00000004
  3873. #define DIAH_HWDEFAULT 0x00000008
  3874. #define DIAH_OTHERAPP 0x00000010 ;internal_800
  3875. #define DIAH_DEFAULT 0x00000020
  3876. #define DIAH_MAPMASK 0x0000003F ;internal_800
  3877. #define DIAH_ERROR 0x80000000
  3878. #define DIAH_VALID 0x8000003F ;internal_800
  3879. begindoc
  3880. /****************************************************************************
  3881. *
  3882. * @doc EXTERNAL
  3883. *
  3884. * @struct DIACTIONFORMAT |
  3885. *
  3886. * The <t DIACTIONFORMAT> structure is used by the
  3887. * <mf IDirectInputDevice::SetDataFormat> method
  3888. * to set the data format for a device.
  3889. * a device.
  3890. *
  3891. * @field DWORD | dwSize |
  3892. *
  3893. * The size of the <t DIACTIONFORMAT> structure.
  3894. *
  3895. * @field DWORD | dwActionSize |
  3896. *
  3897. * The size of the <t DIACTION> structure.
  3898. *
  3899. * @field DWORD | dwDataSize |
  3900. *
  3901. * The size of the device data that should be returned by
  3902. * the device.
  3903. *
  3904. * @field DWORD | dwNumActions |
  3905. *
  3906. * The number of actions in the <e DIACTIONFORMAT.rgoAction>
  3907. * array.
  3908. *
  3909. * @field LPDIACTION | rgoAction |
  3910. *
  3911. * Pointer to an array of <t DIACTION> structures,
  3912. * each of which describes how one object's data should be
  3913. * reported in the device data.
  3914. *
  3915. * @field GUID | guidActionMap |
  3916. *
  3917. * Unique GUID that identifies the action map. An application needs
  3918. * one for each distinct set of semantics it uses.
  3919. *
  3920. * @field DWORD | dwGenre |
  3921. *
  3922. * Genre of the application.
  3923. *
  3924. * @field DWORD | dwBufferSize |
  3925. *
  3926. * BufferSize to set for each device to which this action map is
  3927. * applied.
  3928. * This value will be used as the <e DIPROPDWORD.dwData> value to
  3929. * set the DIPROP_BUFFERSIZE property on the device when the action
  3930. * map is applied using <mf IDirectInputDevice::SetActionMap>.
  3931. * This value is ignored by all other methods.
  3932. *
  3933. * @field OPTIONAL LONG | lAxisMin |
  3934. *
  3935. * Minimum value for range of scaled data to be returned for all
  3936. * axes. This value will be ignored for a specific action axis if
  3937. * the <c DIA_NORANGE> flag is set in <e DIACTION.dwFlags>.
  3938. * This value is currently only valid for axis actions and should be
  3939. * set to zero for all other actions. This value will be used as
  3940. * the <e DIPROPRANGE.lMin> value to set the range property on an
  3941. * absolute axis when the action map is applied using
  3942. * <mf IDirectInputDevice::SetActionMap>.
  3943. *
  3944. * @field OPTIONAL LONG | lAxisMax |
  3945. *
  3946. * Maximum value for range of scaled data to be returned for all
  3947. * axes. This value will be ignored for a specific action axis if
  3948. * the <c DIA_NORANGE> flag is set in <e DIACTION.dwFlags>.
  3949. * This value is currently only valid for axis actions and should be
  3950. * set to zero for all other actions. This value will be used as
  3951. * the <e DIPROPRANGE.lMax> value to set the range property on an
  3952. * absolute axis when the action map is applied using
  3953. * <mf IDirectInputDevice::SetActionMap>.
  3954. *
  3955. * @field OPTIONAL HINSTANCE | hInstString |
  3956. *
  3957. * Handle of the module containing strings for these actions.
  3958. * This is used if DIACTION.lptszActionName has a HIWORD of zero
  3959. * in which case the LOWORD must be a resource ID for a string.
  3960. *
  3961. * @field FILETIME | ftTimeStamp |
  3962. *
  3963. * System time in FILETIME format that this action format was last
  3964. * written to file.
  3965. *
  3966. * @field DWORD | dwCRC |
  3967. *
  3968. * Cyclic redundancy check value generated by
  3969. * <mf IDirectInputDevice::SetActionMap> to check whether or not
  3970. * a mapping needs to be saved.
  3971. * If the input value of this field does not match the calculated
  3972. * value, the mappings for the device are saved and the field is
  3973. * updated. The input value is ignored if the <f DIDSAM_FORCESAVE>
  3974. * flag is set in the dwFlags parameter.
  3975. *
  3976. * @field TCHAR | tszActionMap[MAX_PATH] |
  3977. *
  3978. * Friendly name for this set of actions. May be displayed to user.
  3979. *
  3980. ****************************************************************************/
  3981. enddoc
  3982. typedef struct _DIACTIONFORMAT% {
  3983. DWORD dwSize;
  3984. DWORD dwActionSize;
  3985. DWORD dwDataSize;
  3986. DWORD dwNumActions;
  3987. LPDIACTION% rgoAction;
  3988. GUID guidActionMap;
  3989. DWORD dwGenre;
  3990. DWORD dwBufferSize;
  3991. OPTIONAL LONG lAxisMin;
  3992. OPTIONAL LONG lAxisMax;
  3993. OPTIONAL HINSTANCE hInstString;
  3994. FILETIME ftTimeStamp;
  3995. DWORD dwCRC;
  3996. TCHAR% tszActionMap[MAX_PATH];
  3997. } DIACTIONFORMAT%, *LPDIACTIONFORMAT%;
  3998. typedef const DIACTIONFORMAT% *LPCDIACTIONFORMAT%;
  3999. typedef const DIACTIONFORMAT *LPCDIACTIONFORMAT;
  4000. begindoc
  4001. /****************************************************************************
  4002. *
  4003. * @doc EXTERNAL
  4004. *
  4005. * @flags DirectInput <e DIACTIONFORMAT.ftTimeStamp> |
  4006. *
  4007. * @flag DIAFTS_NEWDEVICEHIGH |
  4008. *
  4009. * Value in <e dwHighDateTime> which when combined with a value of
  4010. * <c DIAFTS_NEWDEVICELOW> in <e dwLowDateTime> signifies that the
  4011. * device to which this action format is being mapped is new for
  4012. * this user.
  4013. *
  4014. * @flag DIAFTS_NEWDEVICELOW |
  4015. *
  4016. * Value in <e dwHighDateLow> which when combined with a value of
  4017. * <c DIAFTS_NEWDEVICEHIGH> in <e dwHighDateTime> signifies that the
  4018. * device to which this action format is being mapped is new for
  4019. * this user.
  4020. *
  4021. * @flag DIAFTS_UNUSEDDEVICEHIGH |
  4022. *
  4023. * Value in <e dwHighDateTime> which when combined with a value of
  4024. * <c DIAFTS_UNUSEDDEVICELOW> in <e dwLowDateTime> signifies that the
  4025. * device to which this action format is being mapped has never been
  4026. * used by this user.
  4027. *
  4028. * @flag DIAFTS_UNUSEDDEVICELOW |
  4029. *
  4030. * Value in <e dwHighDateLow> which when combined with a value of
  4031. * <c DIAFTS_NEWDEVICEHIGH> in <e dwHighDateTime> signifies that the
  4032. * device to which this action format is being mapped has never been
  4033. * used by this user.
  4034. *
  4035. ****************************************************************************/
  4036. enddoc
  4037. #define DIAFTS_NEWDEVICELOW 0xFFFFFFFF
  4038. #define DIAFTS_NEWDEVICEHIGH 0xFFFFFFFF
  4039. #define DIAFTS_UNUSEDDEVICELOW 0x00000000
  4040. #define DIAFTS_UNUSEDDEVICEHIGH 0x00000000
  4041. begindoc
  4042. /****************************************************************************
  4043. *
  4044. * @doc EXTERNAL
  4045. *
  4046. * @flags Flag passed to <mf IDirectInputDevice::BuildActionMap> to control
  4047. * specific behaviors of the method.
  4048. *
  4049. * @flag DIDBAM_DEFAULT |
  4050. *
  4051. * Request default mapping.
  4052. *
  4053. * @flag DIDBAM_PRESERVE |
  4054. *
  4055. * Request that any mappings already set in the action array should
  4056. * be preserved rather than cleared.
  4057. *
  4058. * @flag DIDBAM_INITIALIZE |
  4059. *
  4060. * Indicate that the <e DIACTION.dwFlags> value of each element
  4061. * needs to be initialized.
  4062. *
  4063. * @flag DIDBAM_HWDEFAULTS |
  4064. *
  4065. * Indicate that hardware default mappings rather than user mappings
  4066. * should be used to map unmapped controls.
  4067. *
  4068. * @comm At most one of <c DIDBAM_PRESERVE>, <c DIDBAM_INITIALIZE>
  4069. * and <c DIDBAM_HWDEFAULTS> may be passed to
  4070. * <mf IDirectInputDevice::BuildActionMap>. "It is an error" to
  4071. * pass more than one.
  4072. *
  4073. ****************************************************************************/
  4074. enddoc
  4075. #define DIDBAM_DEFAULT 0x00000000
  4076. #define DIDBAM_PRESERVE 0x00000001
  4077. #define DIDBAM_INITIALIZE 0x00000002
  4078. #define DIDBAM_HWDEFAULTS 0x00000004
  4079. #define DIDBAM_VALID 0x00000007 ;internal
  4080. begindoc
  4081. /****************************************************************************
  4082. *
  4083. * @doc EXTERNAL
  4084. *
  4085. * @flags Flag passed to <mf IDirectInputDevice::SetActionMap> to
  4086. * specify map setting behavior.
  4087. *
  4088. * @flag DIDSAM_DEFAULT |
  4089. *
  4090. * Default action-to-control map setting for this user.
  4091. * If the map differs from the currently set map, the new settings
  4092. * are saved to disk.
  4093. *
  4094. * @flag DIDSAM_NOUSER |
  4095. *
  4096. * (Used only for default UI). Specify that user ownership for this
  4097. * device in the default configuration UI should be set to no owner.
  4098. * Resetting user ownership does not remove the currently set
  4099. * action-to-control map.
  4100. *
  4101. * @flag DIDSAM_FORCESAVE |
  4102. *
  4103. * Specify that device mappings should be saved even if they
  4104. * device in the default configuration UI should be set to no owner.
  4105. * Resetting user ownership does not remove the currently set
  4106. * action-to-control map.
  4107. *
  4108. ****************************************************************************/
  4109. enddoc
  4110. #define DIDSAM_DEFAULT 0x00000000
  4111. #define DIDSAM_NOUSER 0x00000001
  4112. #define DIDSAM_FORCESAVE 0x00000002
  4113. #define DIDSAM_VALID 0x00000003 ;internal
  4114. begindoc
  4115. /****************************************************************************
  4116. *
  4117. * @doc EXTERNAL
  4118. *
  4119. * @flags Flag passed to <mf IDirectInput::ConfigureDevices> to control
  4120. * behavior of the method.
  4121. *
  4122. * @flag DICD_DEFAULT |
  4123. *
  4124. * Request default behavior.
  4125. *
  4126. * @flag DICD_EDIT | 0x00000001 |
  4127. *
  4128. * Request mode of default UI allowing editing of placements of
  4129. * things on configuration dailog.
  4130. *
  4131. ****************************************************************************/
  4132. enddoc
  4133. #define DICD_DEFAULT 0x00000000
  4134. #define DICD_EDIT 0x00000001
  4135. #define DICD_VALID 0x00000001 ;internal
  4136. begindoc
  4137. /****************************************************************************
  4138. *
  4139. * @doc EXTERNAL
  4140. *
  4141. * @struct DICOLORSET |
  4142. *
  4143. * The <t DICOLORSET> structure contains colors that DirectInput
  4144. * uses to draw the configuration user interface. All colors are
  4145. * <t D3DCOLOR> values.
  4146. *
  4147. * @field DWORD | dwSize |
  4148. *
  4149. * Size of the <t DICOLORSET> structure, in bytes. This must be
  4150. * initialized before the structure can be used.
  4151. *
  4152. * @field D3DCOLOR | cTextFore |
  4153. *
  4154. * Foreground text color.
  4155. *
  4156. * @field D3DCOLOR | cTextHighlight |
  4157. *
  4158. * Foreground color for highlighted text.
  4159. *
  4160. * @field D3DCOLOR | cCalloutLine |
  4161. *
  4162. * Color used to display callout lines within the UI.
  4163. *
  4164. * @field D3DCOLOR | cCalloutHighlight |
  4165. *
  4166. * Color used to display highlighted callout lines within the UI.
  4167. *
  4168. * @field D3DCOLOR | cBorder |
  4169. *
  4170. * Border color, used to display lines around UI elements (tabs,
  4171. * buttons, etc).
  4172. *
  4173. * @field D3DCOLOR | cControlFill |
  4174. *
  4175. * Fill color for UI elements (tabs, buttons, etc). Text within UI
  4176. * elements is shown over this fill color.
  4177. *
  4178. * @field D3DCOLOR | cHighlightFill |
  4179. *
  4180. * Fill color for highlighted UI elements (tabs, buttons, etc).
  4181. * Text within UI elements is shown over this fill color.
  4182. *
  4183. * @field D3DCOLOR | cAreaFill |
  4184. *
  4185. * Fill color for areas outside UI elements.
  4186. *
  4187. *
  4188. ****************************************************************************/
  4189. enddoc
  4190. /*
  4191. * The following definition is normally defined in d3dtypes.h
  4192. */
  4193. #ifndef D3DCOLOR_DEFINED
  4194. typedef DWORD D3DCOLOR;
  4195. #define D3DCOLOR_DEFINED
  4196. #endif
  4197. typedef struct _DICOLORSET{
  4198. DWORD dwSize;
  4199. D3DCOLOR cTextFore;
  4200. D3DCOLOR cTextHighlight;
  4201. D3DCOLOR cCalloutLine;
  4202. D3DCOLOR cCalloutHighlight;
  4203. D3DCOLOR cBorder;
  4204. D3DCOLOR cControlFill;
  4205. D3DCOLOR cHighlightFill;
  4206. D3DCOLOR cAreaFill;
  4207. } DICOLORSET, *LPDICOLORSET;
  4208. typedef const DICOLORSET *LPCDICOLORSET;
  4209. begindoc
  4210. /****************************************************************************
  4211. *
  4212. * @doc EXTERNAL
  4213. *
  4214. * @struct DICONFIGUREDEVICESPARAMS |
  4215. *
  4216. * The <t DICONFIGUREDEVICESPARAMS> structure carries parameters used by the
  4217. * IDirectInput8::ConfigureDevices method.
  4218. *
  4219. * @field DWORD | dwSize |
  4220. * Size of the structure, in bytes. This must be initialized before the structure
  4221. * can be used.
  4222. *
  4223. * @field DWORD | dwcUsers |
  4224. *
  4225. * Count of user names in the array at lptszUserNames. Zero is an invalid value.
  4226. * If this value exceeds the number of names actually in the array at lptszUserNames,
  4227. * the method fails, returning DIERR_INVALIDPARAMS.
  4228. *
  4229. * @field LPTSTR | lptszUserNames |
  4230. *
  4231. * Address of an array TCHAR buffers, each of length MAX_PATH, where each element is
  4232. * a null terminated user name string. This parameter can be set to NULL to request
  4233. * default names (the number of which is determined by dwcUsers). For example:
  4234. * // Create an array that can hold 3 names
  4235. * TCHAR szrgNameArray[n][MAX_PATH]
  4236. * If the application passes more names than the count indicates, only the names within
  4237. * the count are used, and remaining devices. If an application specifies names that are
  4238. * different from the names currently assigned to devices, ownership is revoked for all
  4239. * devices, a default name is created for the mismatched name, and the UI shows "(No User)"
  4240. * for all devices.
  4241. *
  4242. * @field DWORD | dwcFormats |
  4243. *
  4244. * Count of structures in the array at lprgFormats.
  4245. *
  4246. * @field LPDIACTIONFORMAT | lprgFormats |
  4247. *
  4248. * Pointer to an array of DIACTIONFORMAT structures that contains action mapping information
  4249. * for each genre the game uses, to be utilized by the control panel. On input, each action-to-control
  4250. * mapping provides the desired genre semantics and the human-readable strings to be displayed as
  4251. * callouts for those semantics, as mapped to the installed devices. The configuration UI displays
  4252. * the genres in its drop-down list in the order they appear in the array.
  4253. *
  4254. * @field HWND | hwnd |
  4255. *
  4256. * Window handle for the top-level window of the calling application. The member is needed only
  4257. * for applications that run in windowed mode. It is otherwise ignored.
  4258. *
  4259. * @field DICOLORSET | dics |
  4260. *
  4261. * A <t DICOLORSET> structure that describes the color scheme to be applied to the configuration
  4262. * user interface.
  4263. *
  4264. * @field IUnknown FAR * | lpUnkDDSTarget |
  4265. *
  4266. * Pointer to the IUnknown interface for a DirectDraw or Direct3D target surface object for the
  4267. * configuration user interface. The device image is alpha-blended over the background surface onto
  4268. * the target surface. The object referred to by this interface must support either IDirect3DSurface,
  4269. * or the following versions of the DirectDraw surface interface: IDirectDrawSurface4, IDirectDrawSurface7.
  4270. *
  4271. *
  4272. ****************************************************************************/
  4273. enddoc
  4274. typedef struct _DICONFIGUREDEVICESPARAMS%{
  4275. DWORD dwSize;
  4276. DWORD dwcUsers;
  4277. LPTSTR% lptszUserNames;
  4278. DWORD dwcFormats;
  4279. LPDIACTIONFORMAT% lprgFormats;
  4280. HWND hwnd;
  4281. DICOLORSET dics;
  4282. IUnknown FAR * lpUnkDDSTarget;
  4283. } DICONFIGUREDEVICESPARAMS%, *LPDICONFIGUREDEVICESPARAMS%;
  4284. typedef const DICONFIGUREDEVICESPARAMS% *LPCDICONFIGUREDEVICESPARAMS%;
  4285. typedef const DICONFIGUREDEVICESPARAMS *LPCDICONFIGUREDEVICESPARAMS;
  4286. begindoc
  4287. /****************************************************************************
  4288. *
  4289. * @doc EXTERNAL
  4290. *
  4291. * @flags <e DIDEVICEIMAGEINFO.dwFlags> |
  4292. *
  4293. * These flags are used to indicate the file format and image usage.
  4294. *
  4295. * @flag DIDIFT_CONFIGURATION |
  4296. *
  4297. * The file is for use to display the current configuration of
  4298. * actions on the device. Overlay image coordinate are given
  4299. * relative to the upper left corner of the configuration image. The
  4300. * <e DIDEVICEIMAGEINFO.rcOverlay> member is valid and identifies
  4301. * view to which this image belongs.
  4302. *
  4303. * @flag DIDIFT_CONTROL |
  4304. *
  4305. * The image info is an overlay for a configuration image. The
  4306. * <e DIDEVICEIMAGEINFO.dwViewID>,
  4307. * <e DIDEVICEIMAGEINFO.rcOverlay>,
  4308. * <e DIDEVICEIMAGEINFO.dwObjID>,
  4309. * <e DIDEVICEIMAGEINFO.dwcValidPts>,
  4310. * <e DIDEVICEIMAGEINFO.rgptCalloutLine>,
  4311. * <e DIDEVICEIMAGEINFO.rcCalloutRect> and
  4312. * <e DIDEVICEIMAGEINFO.dwTextAlign> members are valid and contain
  4313. * data used to display the overlay and callout information for a
  4314. * single control on the device. Note, with the exception of
  4315. * <e DIDEVICEIMAGEINFO.dwObjID>, the data may be NULL data if no
  4316. * data was supplied by the hardware vendor.
  4317. *
  4318. ****************************************************************************/
  4319. enddoc
  4320. #define DIDIFT_CONFIGURATION 0x00000001
  4321. #define DIDIFT_OVERLAY 0x00000002
  4322. #define DIDIFTT_VALID 0x00000003 ;internal
  4323. /*#define DIDIFT_DELETE 0x01000000 defined in dinput.w*/;internal
  4324. #define DIDIFT_VALID ( DIDIFTT_VALID);internal
  4325. begindoc
  4326. /****************************************************************************
  4327. *
  4328. * @doc EXTERNAL
  4329. *
  4330. * @flags <t DIDEVICEIMAGEINFO> flags used to represent text alignment |
  4331. *
  4332. * @flag DIDAL_CENTERED |
  4333. *
  4334. * Allign to center (default).
  4335. *
  4336. * @flag DIDAL_LEFTALIGNED |
  4337. *
  4338. * Allign to left.
  4339. *
  4340. * @flag DIDAL_RIGHTALIGNED |
  4341. *
  4342. * Allign to right.
  4343. *
  4344. * @flag DIDAL_MIDDLE |
  4345. *
  4346. * Allign half way between top and bottom (default).
  4347. *
  4348. * @flag DIDAL_TOPALIGNED |
  4349. *
  4350. * Allign to top.
  4351. *
  4352. * @flag DIDAL_BOTTOMALIGNED |
  4353. *
  4354. * Allign to bottom.
  4355. *
  4356. ****************************************************************************/
  4357. enddoc
  4358. #define DIDAL_CENTERED 0x00000000
  4359. #define DIDAL_LEFTALIGNED 0x00000001
  4360. #define DIDAL_RIGHTALIGNED 0x00000002
  4361. #define DIDAL_MIDDLE 0x00000000
  4362. #define DIDAL_TOPALIGNED 0x00000004
  4363. #define DIDAL_BOTTOMALIGNED 0x00000008
  4364. #define DIDAL_VALID 0x0000000F // ;internal
  4365. begindoc
  4366. /****************************************************************************
  4367. *
  4368. * @doc EXTERNAL
  4369. *
  4370. * @struct DIDEVICEIMAGEINFO |
  4371. *
  4372. * The <t DIDEVICEIMAGEINFO> structure carries information required
  4373. * to display a device image, or an overlay image with a callout.
  4374. * This structure is used by the
  4375. * <mf IDirectInputDevice8::GetImageInfo> method, as an array
  4376. * contained within a <t DIDEVICEIMAGEINFOHEADER> structure.
  4377. *
  4378. * @field TCHAR | lptszImagePath[MAX_PATH] |
  4379. *
  4380. * Fully qualified path to the file that contains an image of the
  4381. * device. File format is given in
  4382. * <e DIDEVICEIMAGEINFO.dwFlags>.
  4383. *
  4384. * @field DWORD | dwFlags |
  4385. *
  4386. * A combination of <c DIDIFT_*> values that describe
  4387. * the file format and intended use of the image. Not all flag
  4388. * combinations are valid.
  4389. *
  4390. * @field DWORD | dwViewID |
  4391. *
  4392. * View ID of the device configuration image over which this overlay
  4393. * is to be displayed.
  4394. *
  4395. * @field RECT | rcOverlay |
  4396. *
  4397. * Rectangle, using coordinates relative to the top-left pixel of
  4398. * the device configuration image, in which the overlay image
  4399. * should be painted.
  4400. * This member is only valid if the <c DIDIFT_OVERLAY> flag is
  4401. * present in <e DIDEVICEIMAGEINFO.dwFlags>.
  4402. *
  4403. * @field DWORD | dwObjID |
  4404. *
  4405. * Control ID (as a combination of DIDFT_* flags and an instance
  4406. * value) to which an overlay image corresponds for this device.
  4407. * Applications use the DIDFT_GETINSTANCE and DIDFT_GETTYPE macros
  4408. * to decode this value to its constituent parts.
  4409. * This member is only valid if the <c DIDIFT_OVERLAY> flag is
  4410. * present in <e DIDEVICEIMAGEINFO.dwFlags>.
  4411. *
  4412. * @field DWORD | dwcValidPts |
  4413. *
  4414. * Number of valid points in rgptCalloutLine array.
  4415. * This member is only valid if the <c DIDIFT_OVERLAY> flag is
  4416. * present in <e DIDEVICEIMAGEINFO.dwFlags>.
  4417. *
  4418. * @field POINT | rgptCalloutLine[5] |
  4419. *
  4420. * Coordinates for the four points that describe a line with one to
  4421. * four segments that should be displayed as a callout to a game
  4422. * action string from a device control.
  4423. * This member is only valid if the <c DIDIFT_OVERLAY> flag is
  4424. * present in <e DIDEVICEIMAGEINFO.dwFlags>.
  4425. *
  4426. * @field RECT | rcCalloutRect |
  4427. *
  4428. * Rectangle in which the game action string should be displayed.
  4429. * If the string cannot fit within the rectangle, the application
  4430. * is responsible for handling clipping.
  4431. * This member is only valid if the <c DIDIFT_OVERLAY> flag is
  4432. * present in <e DIDEVICEIMAGEINFO.dwFlags>.
  4433. *
  4434. * @field DWORD | dwTextAlign |
  4435. *
  4436. * Any combination of the <c DIDAL_* > text-alignment flags.
  4437. * The text within the rectangle described by
  4438. * <e DIDEVICEIMAGEINFO.rcCalloutRect> should be aligned
  4439. * according to these falgs.
  4440. * This member is only valid if the <c DIDIFT_OVERLAY> flag is
  4441. * present in <e DIDEVICEIMAGEINFO.dwFlags>.
  4442. *
  4443. ****************************************************************************/
  4444. enddoc
  4445. typedef struct _DIDEVICEIMAGEINFO% {
  4446. TCHAR% tszImagePath[MAX_PATH];
  4447. DWORD dwFlags;
  4448. // These are valid if DIDIFT_OVERLAY is present in dwFlags.
  4449. DWORD dwViewID;
  4450. RECT rcOverlay;
  4451. DWORD dwObjID;
  4452. DWORD dwcValidPts;
  4453. POINT rgptCalloutLine[5];
  4454. RECT rcCalloutRect;
  4455. DWORD dwTextAlign;
  4456. } DIDEVICEIMAGEINFO%, *LPDIDEVICEIMAGEINFO%;
  4457. typedef const DIDEVICEIMAGEINFO% *LPCDIDEVICEIMAGEINFO%;
  4458. typedef const DIDEVICEIMAGEINFO *LPCDIDEVICEIMAGEINFO;
  4459. begindoc
  4460. /****************************************************************************
  4461. *
  4462. * @doc EXTERNAL
  4463. *
  4464. * @struct DIDEVICEIMAGEINFOHEADER |
  4465. *
  4466. * The <t DIDEVICEIMAGEINFOHEADER> structure provides general
  4467. * variable-length array of <t DIDEVICEIMAGE> structures.
  4468. * This structure is used by the
  4469. * <mf IDirectInputDevice8::GetImageInfo> method.
  4470. *
  4471. * @field DWORD | dwSize |
  4472. *
  4473. * The size of the <t DIDEVICEIMAGEINFOHEADER> structure.
  4474. *
  4475. * @field DWORD | dwSizeImageInfo |
  4476. *
  4477. * The size of each <t DIDEVICEIMAGEINFO> element in the
  4478. * <e DIDEVICEIMAGEINFOHEADER.lprgImageInfo> array.
  4479. *
  4480. * @field DWORD | dwcViews |
  4481. *
  4482. * Count of views for this device. Each represents a unique view
  4483. * of the device.
  4484. *
  4485. * @field DWORD | dwcButtons |
  4486. *
  4487. * Count of buttons for the device.
  4488. *
  4489. * @field DWORD | dwcAxes |
  4490. *
  4491. * Count of axes for the device.
  4492. *
  4493. * @field DWORD | dwcPOVs |
  4494. *
  4495. * Count of POVs for the device.
  4496. *
  4497. * @field DWORD | dwBufferSize |
  4498. *
  4499. * Size, in bytes, of the buffer pointed to by
  4500. * <e DIDEVICEIMAGEINFOHEADER.lprgImageInfo>.
  4501. *
  4502. * @field DWORD | dwBufferUsed |
  4503. *
  4504. * Size, in bytes, of the memory used within the buffer pointed to
  4505. * by <e DIDEVICEIMAGEINFOHEADER.lprgImageInfo>.
  4506. *
  4507. * @field LPDIDEVICEIMAGEINFO | lprgImageInfoArray |
  4508. *
  4509. * Buffer to be filled with an array of <t DIDEVICEIMAGEINFO>
  4510. * structures that describe all of the device images and views,
  4511. * overlay images, and callout-string coordinates.
  4512. *
  4513. * @comm The buffer at <e DIDEVICEIMAGEINFOHEADER.lprgImageInfo> must be
  4514. * large enough to hold all required image information structures.
  4515. * Applications can query for the required size by calling the
  4516. * <mf IDirectInputDevice8::GetImageInfo> method with the
  4517. * <e DIDEVICEIMAGEINFOHEADER.dwBufferSize> is set to zero.
  4518. * After the call, <e DIDEVICEIMAGEINFOHEADER.dwBufferUsed>
  4519. * contains the minimum buffer size required to contain all the
  4520. * available image information structures.
  4521. *
  4522. * The dwcButtons, dwcAxes and dwcPOVs members contain data that can
  4523. * be retrieved elsewhere within DirectInput, but that would require
  4524. * additional code. These are included for ease-of-use for the
  4525. * application developer.
  4526. *
  4527. ****************************************************************************/
  4528. enddoc
  4529. typedef struct _DIDEVICEIMAGEINFOHEADER% {
  4530. DWORD dwSize;
  4531. DWORD dwSizeImageInfo;
  4532. DWORD dwcViews;
  4533. DWORD dwcButtons;
  4534. DWORD dwcAxes;
  4535. DWORD dwcPOVs;
  4536. DWORD dwBufferSize;
  4537. DWORD dwBufferUsed;
  4538. LPDIDEVICEIMAGEINFO% lprgImageInfoArray;
  4539. } DIDEVICEIMAGEINFOHEADER%, *LPDIDEVICEIMAGEINFOHEADER%;
  4540. typedef const DIDEVICEIMAGEINFOHEADER% *LPCDIDEVICEIMAGEINFOHEADER%;
  4541. typedef const DIDEVICEIMAGEINFOHEADER *LPCDIDEVICEIMAGEINFOHEADER;
  4542. #endif /* DIRECTINPUT_VERSION > 0x0700 */
  4543. ;end_public_800
  4544. begindoc
  4545. /****************************************************************************
  4546. *
  4547. * @doc EXTERNAL
  4548. *
  4549. * @struct DIDEVICEOBJECTINSTANCE |
  4550. *
  4551. * The <t DIDEVICEOBJECTINSTANCE> structure is used by the
  4552. * <mf IDirectInputDevice::EnumObjects> and
  4553. * <mf IDirectInputDevice::GetObjectInfo> methods
  4554. * to return information about a particular object on a device.
  4555. *
  4556. * @field DWORD | dwSize |
  4557. *
  4558. * The size of the structure in bytes. The application may
  4559. * inspect this value to determine how many fields of the
  4560. * structure are valid. For DirectInput 3.0, the value will
  4561. * be sizeof(DIDEVICEOBJECTINSTANCE30).
  4562. * For DirectInput 5.0, the value will
  4563. * be sizeof(DIDEVICEOBJECTINSTANCE).
  4564. * Future versions of
  4565. * DirectInput may return a larger structure.
  4566. *
  4567. * @field GUID | guidType |
  4568. *
  4569. * Identifier which indicates the type of the object.
  4570. * This field is optional. If present, it may be one of the
  4571. * following values:
  4572. *
  4573. * <c GUID_XAxis>: This is the horizontal axis of a controller.
  4574. * For example, it may represent the horizontal motion of a mouse
  4575. * or left-right motion of a joystick.
  4576. *
  4577. * <c GUID_YAxis>: This is the forward/backwards
  4578. * axis of a controller.
  4579. * For example, it may represent motion of a mouse towards or
  4580. * away from the user, or forward/backward motion of a joystick.
  4581. *
  4582. * <c GUID_ZAxis>: This is the vertical axis of a controller.
  4583. * For example, it may represent rotation of the Z-wheel on
  4584. * a mouse.
  4585. *
  4586. * <c GUID_Button>: This is a button on a game controller.
  4587. *
  4588. * <c GUID_Key>: This is a key on a keypad.
  4589. *
  4590. * Other object types may be defined in the future. (For example,
  4591. * <c GUID_Fire>, <c GUID_Throttle>, <c GUID_SteeringWheel>.)
  4592. *
  4593. * @field DWORD | dwOfs |
  4594. *
  4595. * Offset within the data format at which the data reported
  4596. * by this object is most efficiently obtained.
  4597. *
  4598. * @field DWORD | dwType |
  4599. *
  4600. * Device type specifier which describes the object.
  4601. * It is a combination of <c DIDFT_*> flags which describe
  4602. * the object type (axis, button, etc.) and contains the
  4603. * object instance number in the high byte. Use the
  4604. * <f DIDFT_GETINSTANCE> macro to extract the object instance
  4605. * number.
  4606. *
  4607. * @field DWORD | dwFlags |
  4608. *
  4609. * Zero or more <c DIDOI_*> values.
  4610. *
  4611. * @field TCHAR | tszName[MAX_PATH] |
  4612. *
  4613. * Name of the object. For example, "Sine wave"
  4614. * or "Spring".
  4615. *
  4616. * @field DWORD | dwFFMaxForce |
  4617. *
  4618. * Specifies the magnitude of the maximum force that can
  4619. * be created by the actuator associated with this object.
  4620. * Force is
  4621. * expressed in Newtons and measured in relation to where
  4622. * the hand would be during normal operation of the device.
  4623. *
  4624. * This field is new for DirectX 5.0.
  4625. *
  4626. * @field DWORD | dwFFForceResolution |
  4627. *
  4628. * Specifies the force resolution of the actuator
  4629. * associated with this object.
  4630. * The returned value represents
  4631. * the number of gradations, or subdivisions, of the
  4632. * maximum force that can be expressed by the force feedback
  4633. * system from 0 (no force) to maximum force.
  4634. *
  4635. * This field is new for DirectX 5.0.
  4636. *
  4637. * @field WORD | wCollectionNumber |
  4638. *
  4639. * If the device is a HID device, then this field
  4640. * specifies the HID link collection to which the
  4641. * object belongs. To enumerate all the objects
  4642. * inside a single link collection use
  4643. * the <mf IDirectInputDevice2::EnumObjects>
  4644. * method with the
  4645. * <c DIDFT_ENUMCOLLECTION(n)> flag.
  4646. *
  4647. * This field is new for DirectX 5.0.
  4648. *
  4649. * @field WORD | wDesignatorIndex |
  4650. *
  4651. * An index that refers to a designator in the
  4652. * HID physical descriptor. This number can be
  4653. * passed to functions in the HID parsing library
  4654. * (hidpi.h) to obtain additional information
  4655. * about the device object.
  4656. *
  4657. * This field is new for DirectX 5.0.
  4658. *
  4659. * @field WORD | wUsagePage |
  4660. *
  4661. * The HID usage page code, if known, or zero if not known.
  4662. * Applications can use this field to determine the semantics
  4663. * associated with the object.
  4664. * See the hidusage.h header file for a list of usage pages.
  4665. *
  4666. * HID devices will always provide a valid usage page.
  4667. * Non-HID devices may or may not provide a valid usage page,
  4668. * at the device's discretion. If the usage page is not
  4669. * known, the value of this field is zero.
  4670. *
  4671. * This field is new for DirectX 5.0.
  4672. *
  4673. * @field WORD | wUsage |
  4674. *
  4675. * The HID usage code, if known, or zero if not known.
  4676. * Applications can use this field to determine the semantics
  4677. * associated with the object.
  4678. * See the hidusage.h header file for a list of usages.
  4679. *
  4680. * HID devices will always provide a valid usage.
  4681. * Non-HID devices may or may not provide a valid usage,
  4682. * at the device's discretion. If the usage is not
  4683. * known, the value of this field is zero.
  4684. *
  4685. * This field is new for DirectX 5.0.
  4686. *
  4687. * @field DWORD | dwDimension |
  4688. *
  4689. * The dimensional units in which the object's value is
  4690. * reported, if
  4691. * known, or zero if not known.
  4692. * Applications can use this field to distinguish between,
  4693. * for example, the position and velocity of a control.
  4694. *
  4695. * This field is new for DirectX 5.0.
  4696. *
  4697. * @field WORD | wExponent |
  4698. *
  4699. * The exponent to associate with the dimension, if known.
  4700. *
  4701. * This field is new for DirectX 5.0.
  4702. *
  4703. * @field WORD | wReportId |
  4704. * The HID ReportId, if known. This number can be
  4705. * passed to functions in the HID library
  4706. * (hid.dll) to obtain features/send output to
  4707. * that pertain to the report ID.
  4708. *
  4709. * This field is new for DirectX 6.1a.
  4710. *
  4711. *
  4712. ****************************************************************************/
  4713. enddoc
  4714. ;begin_if_(DIRECTINPUT_VERSION)_500
  4715. /* These structures are defined for DirectX 3.0 compatibility */
  4716. typedef struct DIDEVICEOBJECTINSTANCE_DX3% {
  4717. DWORD dwSize;
  4718. GUID guidType;
  4719. DWORD dwOfs;
  4720. DWORD dwType;
  4721. DWORD dwFlags;
  4722. TCHAR% tszName[MAX_PATH];
  4723. } DIDEVICEOBJECTINSTANCE_DX3%, *LPDIDEVICEOBJECTINSTANCE_DX3%;
  4724. typedef const DIDEVICEOBJECTINSTANCE_DX3A *LPCDIDEVICEOBJECTINSTANCE_DX3A;
  4725. typedef const DIDEVICEOBJECTINSTANCE_DX3W *LPCDIDEVICEOBJECTINSTANCE_DX3W;
  4726. typedef const DIDEVICEOBJECTINSTANCE_DX3 *LPCDIDEVICEOBJECTINSTANCE_DX3;
  4727. ;end
  4728. typedef struct DIDEVICEOBJECTINSTANCE% {
  4729. DWORD dwSize;
  4730. GUID guidType;
  4731. DWORD dwOfs;
  4732. DWORD dwType;
  4733. DWORD dwFlags;
  4734. TCHAR% tszName[MAX_PATH];
  4735. ;begin_if_(DIRECTINPUT_VERSION)_500
  4736. DWORD dwFFMaxForce;
  4737. DWORD dwFFForceResolution;
  4738. WORD wCollectionNumber;
  4739. WORD wDesignatorIndex;
  4740. WORD wUsagePage;
  4741. WORD wUsage;
  4742. DWORD dwDimension;
  4743. WORD wExponent;
  4744. WORD wReportId;
  4745. ;end
  4746. } DIDEVICEOBJECTINSTANCE%, *LPDIDEVICEOBJECTINSTANCE%;
  4747. typedef const DIDEVICEOBJECTINSTANCEA *LPCDIDEVICEOBJECTINSTANCEA;
  4748. typedef const DIDEVICEOBJECTINSTANCEW *LPCDIDEVICEOBJECTINSTANCEW;
  4749. typedef const DIDEVICEOBJECTINSTANCE *LPCDIDEVICEOBJECTINSTANCE;
  4750. typedef BOOL (FAR PASCAL * LPDIENUMDEVICEOBJECTSCALLBACK%)(LPCDIDEVICEOBJECTINSTANCE%, LPVOID);
  4751. ;begin_internal
  4752. #define HAVE_DIDEVICEOBJECTINSTANCE_DX5
  4753. typedef DIDEVICEOBJECTINSTANCEA DIDEVICEOBJECTINSTANCE_DX5A;
  4754. typedef DIDEVICEOBJECTINSTANCEW DIDEVICEOBJECTINSTANCE_DX5W;
  4755. typedef DIDEVICEOBJECTINSTANCE DIDEVICEOBJECTINSTANCE_DX5;
  4756. typedef DIDEVICEOBJECTINSTANCEA *LPDIDEVICEOBJECTINSTANCE_DX5A;
  4757. typedef DIDEVICEOBJECTINSTANCEW *LPDIDEVICEOBJECTINSTANCE_DX5W;
  4758. typedef DIDEVICEOBJECTINSTANCE *LPDIDEVICEOBJECTINSTANCE_DX5;
  4759. typedef const DIDEVICEOBJECTINSTANCEA *LPCDIDEVICEOBJECTINSTANCE_DX5A;
  4760. typedef const DIDEVICEOBJECTINSTANCEW *LPCDIDEVICEOBJECTINSTANCE_DX5W;
  4761. typedef const DIDEVICEOBJECTINSTANCE *LPCDIDEVICEOBJECTINSTANCE_DX5;
  4762. BOOL static __inline
  4763. IsValidSizeDIDEVICEOBJECTINSTANCEW(DWORD cb)
  4764. {
  4765. return cb == sizeof(DIDEVICEOBJECTINSTANCE_DX5W) ||
  4766. cb == sizeof(DIDEVICEOBJECTINSTANCE_DX3W);
  4767. }
  4768. BOOL static __inline
  4769. IsValidSizeDIDEVICEOBJECTINSTANCEA(DWORD cb)
  4770. {
  4771. return cb == sizeof(DIDEVICEOBJECTINSTANCE_DX5A) ||
  4772. cb == sizeof(DIDEVICEOBJECTINSTANCE_DX3A);
  4773. }
  4774. ;end_internal
  4775. begindoc
  4776. /****************************************************************************
  4777. *
  4778. * @doc EXTERNAL
  4779. *
  4780. * @define DIDOI_FFACTUATOR | 0x00000001 |
  4781. *
  4782. * Flag for <t DIDEVICEOBJECTINSTANCE> which indicates
  4783. * that the object can have force feedback effects
  4784. * applied to it.
  4785. *
  4786. * This flag is new for DirectX 5.0.
  4787. *
  4788. * @define DIDOI_FFEFFECTTRIGGER | 0x00000002 |
  4789. *
  4790. * Flag for <t DIDEVICEOBJECTINSTANCE> which indicates
  4791. * that the object can trigger playback of
  4792. * force feedback effects.
  4793. *
  4794. * This flag is new for DirectX 5.0.
  4795. *
  4796. * @define DIDOI_FFINPUT | 0x00000004 |
  4797. *
  4798. * Flag for <t DIDEVICEOBJECTINSTANCE> which indicates
  4799. * that although this object cannot have force feedback effects
  4800. * applied to it, effects which specify this object should not
  4801. * be failed. The effect should be passed down to the driver as
  4802. * though this object had the <c DIDOI_FFACTUATOR> flag set.
  4803. ;begin_internal
  4804. * ISSUE-2001/03/29-timgill FF Flag issue
  4805. * If this flag is set, can you specify a <t DIREGION>
  4806. * using a non-FF axis and apply the effect on FF axes?
  4807. ;end_internal
  4808. *
  4809. * This flag is new for DirectX 9.0.
  4810. *
  4811. * @define DIDOI_ASPECTPOSITION | 0x00000100 |
  4812. *
  4813. * Flag for <t DIDEVICEOBJECTINSTANCE> and
  4814. * <t DIOBJECTDATAFORMAT> which indicates that
  4815. * the object reports position information.
  4816. *
  4817. * This flag is new for DirectX 5.0.
  4818. *
  4819. * @define DIDOI_ASPECTVELOCITY | 0x00000200 |
  4820. *
  4821. * Flag for <t DIDEVICEOBJECTINSTANCE> and
  4822. * <t DIOBJECTDATAFORMAT> which indicates that
  4823. * the object reports velocity information.
  4824. *
  4825. * This flag is new for DirectX 5.0.
  4826. *
  4827. * @define DIDOI_ASPECTACCEL | 0x00000300 |
  4828. *
  4829. * Flag for <t DIDEVICEOBJECTINSTANCE> and
  4830. * <t DIOBJECTDATAFORMAT> which indicates that
  4831. * the object reports acceleration information.
  4832. *
  4833. * This flag is new for DirectX 5.0.
  4834. *
  4835. * @define DIDOI_ASPECTFORCE | 0x00000400 |
  4836. *
  4837. * Flag for <t DIDEVICEOBJECTINSTANCE> and
  4838. * <t DIOBJECTDATAFORMAT> which indicates that
  4839. * the object reports force information.
  4840. *
  4841. * This flag is new for DirectX 5.0.
  4842. *
  4843. * @define DIDOI_ASPECTMASK | 0x00000F00 |
  4844. *
  4845. * Mask for <t DIDEVICEOBJECTINSTANCE> and
  4846. * <t DIOBJECTDATAFORMAT> which indicates the bits
  4847. * that are used to report aspect information.
  4848. *
  4849. * This mask is new for DirectX 5.0.
  4850. * An object can represent at most one aspect.
  4851. *
  4852. * @define DIDOI_POLLED | 0x00008000 |
  4853. *
  4854. * Flag for <t DIDEVICEOBJECTINSTANCE> which indicates
  4855. * that the object must be explicitly polled in order for
  4856. * data to be retrieved from it.
  4857. *
  4858. * If this flag is not set, then data for the object is
  4859. * interrupt-driven.
  4860. *
  4861. * This flag is new for DirectX 5.0.
  4862. *
  4863. * @define DIDOI_GUIDISUSAGE | 0x00010000 |
  4864. *
  4865. * Flag for <t DIOBJECTDATAFORMAT> which indicates that
  4866. * the <t DIOBJECTDATAFORMAT>.pguid field is really a
  4867. * (suitably cast)
  4868. * <c DIMAKEUSAGEDWORD> of the usage page and usage
  4869. * that is desired.
  4870. *
  4871. * This flag is new for DirectX 5.0a.
  4872. *
  4873. ****************************************************************************/
  4874. enddoc
  4875. ;begin_if_(DIRECTINPUT_VERSION)_500
  4876. #define DIDOI_FFACTUATOR 0x00000001
  4877. #define DIDOI_FFEFFECTTRIGGER 0x00000002
  4878. #define DIDOI_POLLED 0x00008000
  4879. #define DIDOI_NOTINPUT 0x80000000;internal
  4880. #define DIDOI_ASPECTUNKNOWN 0x00000000;internal
  4881. #define DIDOI_ASPECTPOSITION 0x00000100
  4882. #define DIDOI_ASPECTVELOCITY 0x00000200
  4883. #define DIDOI_ASPECTACCEL 0x00000300
  4884. #define DIDOI_ASPECTFORCE 0x00000400
  4885. #define DIDOI_ASPECTMASK 0x00000F00
  4886. ;end
  4887. ;begin_if_(DIRECTINPUT_VERSION)_50A
  4888. #define DIDOI_GUIDISUSAGE 0x00010000
  4889. ;end
  4890. #define DIDOI_RANDOM 0x80000000;internal
  4891. begindoc
  4892. /****************************************************************************
  4893. *
  4894. * @doc EXTERNAL
  4895. *
  4896. * @struct DIPROPHEADER |
  4897. *
  4898. * Generic structure which is placed at the beginning of all
  4899. * property structures.
  4900. *
  4901. * @field DWORD | dwSize |
  4902. *
  4903. * (IN) "Must" be the size of the enclosing structure.
  4904. *
  4905. * @field DWORD | dwHeaderSize |
  4906. *
  4907. * (IN) "Must" be the size of the <t DIPROPHEADER> structure.
  4908. *
  4909. * @field DWORD | dwObj |
  4910. *
  4911. * Identifies the object for which the property is to be
  4912. * accessed.
  4913. *
  4914. * If the <e DIPROPHEADER.dwHow> field is
  4915. * <c DIPH_DEVICE>, then the <e DIPROPHEADER.dwObj> field
  4916. * must be zero.
  4917. *
  4918. * If the <e DIPROPHEADER.dwHow> field is
  4919. * <c DIPH_BYOFFSET>, then the <e DIPROPHEADER.dwObj> field
  4920. * is the
  4921. * offset into the current data format of the object
  4922. * whose property is being accessed.
  4923. *
  4924. * If the <e DIPROPHEADER.dwHow> field is
  4925. * <c DIPH_BYID>, then the <e DIPROPHEADER.dwObj> field
  4926. * is the object type/instance identifier as returned in
  4927. * the <p dwType> field of the <t DIDEVICEOBJECTINSTANCE>
  4928. * returned from a prior call to
  4929. * <mf IDirectInputDevice::EnumObjects>.
  4930. *
  4931. * If the <e DIPROPHEADER.dwHow> field is
  4932. * <c DIPH_BYUSAGE>, then the <e DIPROPHEADER.dwObj> field
  4933. * is the HID usage page and usage values, combined into
  4934. * a single <t DWORD> with the
  4935. * <c DIMAKEUSAGEDWORD> macro.
  4936. *
  4937. * If more than object has the specified HID usage page
  4938. * and usage, then one is selected arbitrarily.
  4939. *
  4940. * The <c DIPH_BYUSAGE> value is new for DirectX 5.0a.
  4941. *
  4942. * @field DWORD | dwHow |
  4943. *
  4944. * Specifies how the <e DIPROPHEADER.dwObj>
  4945. * field should be interpreted.
  4946. *
  4947. ****************************************************************************/
  4948. enddoc
  4949. typedef struct DIPROPHEADER {
  4950. DWORD dwSize;
  4951. DWORD dwHeaderSize;
  4952. DWORD dwObj;
  4953. DWORD dwHow;
  4954. } DIPROPHEADER, *LPDIPROPHEADER;
  4955. typedef const DIPROPHEADER *LPCDIPROPHEADER;
  4956. #define DIPH_DEVICE 0
  4957. #define DIPH_BYOFFSET 1
  4958. #define DIPH_BYID 2
  4959. ;begin_if_(DIRECTINPUT_VERSION)_50A
  4960. #define DIPH_BYUSAGE 3
  4961. ;end
  4962. begindoc
  4963. /****************************************************************************
  4964. * @func DWORD | DIMAKEUSAGEDWORD |
  4965. *
  4966. * Combine a usage page and usage into a single <t DWORD>
  4967. * that can be passed in the <e DIPROPHEADER.dwObj>
  4968. * field of a <t DIPROPHEADER> or as the
  4969. * <p dwObj> parameter to the
  4970. * <mf IDirectInputDevice::GetObjectInfo> method,
  4971. * provided that the corresponding <p dwHow> is set to
  4972. * the value <c DIPH_BYUSAGE>.
  4973. *
  4974. * @parm WORD | wUsagePage |
  4975. *
  4976. * HID usage page value.
  4977. *
  4978. * @parm WORD | wUsage |
  4979. *
  4980. * HID usage value.
  4981. *
  4982. * @xref <t DIPROPHEADER>.
  4983. *
  4984. * @devnote NOTE - this is in a different order from that in <t DIOBJECTATTRIBUTES>
  4985. *
  4986. ****************************************************************************/
  4987. enddoc
  4988. ;begin_if_(DIRECTINPUT_VERSION)_50A
  4989. #define DIMAKEUSAGEDWORD(UsagePage, Usage) \
  4990. (DWORD)MAKELONG(Usage, UsagePage)
  4991. ;end
  4992. begindoc
  4993. /****************************************************************************
  4994. *
  4995. * @doc EXTERNAL
  4996. *
  4997. * @struct DIPROPDWORD |
  4998. *
  4999. * Generic structure used to access DWORD properties.
  5000. *
  5001. * @field DIPROPHEADER | diph |
  5002. *
  5003. * (IN) "Must" be preinitialized as follows:
  5004. *
  5005. * <e DIPROPHEADER.dwSize> = sizeof(DIPROPDWORD).
  5006. *
  5007. * <e DIPROPHEADER.dwHeaderSize> = sizeof(DIPROPHEADER).
  5008. *
  5009. * <e DIPROPHEADER.dwObj> = object identifier.
  5010. *
  5011. * <e DIPROPHEADER.dwHow> = how the <e DIPROPHEADER.dwObj>
  5012. * should be interpreted.
  5013. *
  5014. * @field DWORD | dwData |
  5015. *
  5016. * On <f SetProperty>, contains the value of the property to
  5017. * be set. On <f GetProperty>, receives the value of the property.
  5018. *
  5019. ****************************************************************************/
  5020. enddoc
  5021. typedef struct DIPROPDWORD {
  5022. DIPROPHEADER diph;
  5023. DWORD dwData;
  5024. } DIPROPDWORD, *LPDIPROPDWORD;
  5025. typedef const DIPROPDWORD *LPCDIPROPDWORD;
  5026. ;begin_public_dx8
  5027. begindoc
  5028. /****************************************************************************
  5029. *
  5030. * @doc EXTERNAL
  5031. *
  5032. * @struct DIPROPPOINTER |
  5033. *
  5034. * Generic structure used to access POINTER properties.
  5035. *
  5036. * @field DIPROPHEADER | diph |
  5037. *
  5038. * (IN) "Must" be preinitialized as follows:
  5039. *
  5040. * <e DIPROPHEADER.dwSize> = sizeof(DIPROPPOINTER).
  5041. *
  5042. * <e DIPROPHEADER.dwHeaderSize> = sizeof(DIPROPHEADER).
  5043. *
  5044. * <e DIPROPHEADER.dwObj> = object identifier.
  5045. *
  5046. * <e DIPROPHEADER.dwHow> = how the <e DIPROPHEADER.dwObj>
  5047. * should be interpreted.
  5048. *
  5049. * @field UINT_PTR | uData |
  5050. *
  5051. * On <f SetProperty>, contains the value of the property to
  5052. * be set. On <f GetProperty>, receives the value of the property.
  5053. * This field contains enough bits to represent a pointer on the
  5054. * intended platform; 32 bits for Win32, 64 bits for Win64.
  5055. *
  5056. ****************************************************************************/
  5057. enddoc
  5058. ;begin_if_(DIRECTINPUT_VERSION)_800
  5059. typedef struct DIPROPPOINTER {
  5060. DIPROPHEADER diph;
  5061. UINT_PTR uData;
  5062. } DIPROPPOINTER, *LPDIPROPPOINTER;
  5063. typedef const DIPROPPOINTER *LPCDIPROPPOINTER;
  5064. ;end
  5065. ;end_public_dx8
  5066. begindoc
  5067. /****************************************************************************
  5068. *
  5069. * @doc EXTERNAL
  5070. *
  5071. * @struct DIPROPRANGE |
  5072. *
  5073. * Generic structure used to access properties whose values
  5074. * represent a range.
  5075. *
  5076. * @field DIPROPHEADER | diph |
  5077. *
  5078. * (IN) "Must" be preinitialized as follows:
  5079. *
  5080. * <e DIPROPHEADER.dwSize> = sizeof(DIPROPRANGE).
  5081. *
  5082. * <e DIPROPHEADER.dwHeaderSize> = sizeof(DIPROPHEADER).
  5083. *
  5084. * <e DIPROPHEADER.dwObj> = object identifier.
  5085. *
  5086. * <e DIPROPHEADER.dwHow> = how the <e DIPROPHEADER.dwObj>
  5087. * should be interpreted.
  5088. *
  5089. * @field LONG | lMin |
  5090. *
  5091. * The lower limit of the range, inclusive.
  5092. *
  5093. * @field LONG | lMax |
  5094. *
  5095. * The upper limit of the range, inclusive.
  5096. *
  5097. * (Yes, this name is a violation of Hungarian notation.
  5098. * The correct name for this would be "lMac", but that
  5099. * would just create more confusion.)
  5100. *
  5101. * @comm
  5102. * If the device has an unrestricted range, the reported
  5103. * range will have <e DIPROPRANGE.lMin> = DIPROPRANGE_NOMIN
  5104. * and <e DIPROPRANGE.lMax> = DIPROPRANGE_NOMAX. Note that
  5105. * devices with unrestricted range will wrap around.
  5106. *
  5107. ****************************************************************************/
  5108. enddoc
  5109. typedef struct DIPROPRANGE {
  5110. DIPROPHEADER diph;
  5111. LONG lMin;
  5112. LONG lMax;
  5113. } DIPROPRANGE, *LPDIPROPRANGE;
  5114. typedef const DIPROPRANGE *LPCDIPROPRANGE;
  5115. #define DIPROPRANGE_NOMIN ((LONG)0x80000000)
  5116. #define DIPROPRANGE_NOMAX ((LONG)0x7FFFFFFF)
  5117. ;begin_if_(DIRECTINPUT_VERSION)_50A
  5118. begindoc
  5119. /****************************************************************************
  5120. *
  5121. * @doc EXTERNAL
  5122. *
  5123. * @struct DIPROPCAL |
  5124. *
  5125. * Generic structure used to access properties whose values
  5126. * represent axis calibration information.
  5127. *
  5128. * @field DIPROPHEADER | diph |
  5129. *
  5130. * (IN) "Must" be preinitialized as follows:
  5131. *
  5132. * <e DIPROPHEADER.dwSize> = sizeof(DIPROPRANGE).
  5133. *
  5134. * <e DIPROPHEADER.dwHeaderSize> = sizeof(DIPROPHEADER).
  5135. *
  5136. * <e DIPROPHEADER.dwObj> = object identifier.
  5137. *
  5138. * <e DIPROPHEADER.dwHow> = how the <e DIPROPHEADER.dwObj>
  5139. * should be interpreted.
  5140. *
  5141. * @field LONG | lMin |
  5142. *
  5143. * The lower limit of the object's range, inclusive.
  5144. *
  5145. * @field LONG | lCenter |
  5146. *
  5147. * The object value when the device is returned to its
  5148. * natural center position.
  5149. *
  5150. * @field LONG | lMax |
  5151. *
  5152. * The upper limit of the object's range, inclusive.
  5153. *
  5154. * (Yes, this name is a violation of Hungarian notation.
  5155. * The correct name for this would be "lMac", but that
  5156. * would just create more confusion.)
  5157. *
  5158. ****************************************************************************/
  5159. enddoc
  5160. typedef struct DIPROPCAL {
  5161. DIPROPHEADER diph;
  5162. LONG lMin;
  5163. LONG lCenter;
  5164. LONG lMax;
  5165. } DIPROPCAL, *LPDIPROPCAL;
  5166. typedef const DIPROPCAL *LPCDIPROPCAL;
  5167. begindoc
  5168. /****************************************************************************
  5169. *
  5170. * @doc EXTERNAL
  5171. *
  5172. * @struct DIPROPCALPOV |
  5173. *
  5174. * Generic structure used to access properties whose values
  5175. * represent POV calibration information.
  5176. *
  5177. * @field DIPROPHEADER | diph |
  5178. *
  5179. * (IN) "Must" be preinitialized as follows:
  5180. *
  5181. * <e DIPROPHEADER.dwSize> = sizeof(DIPROPRANGE).
  5182. *
  5183. * <e DIPROPHEADER.dwHeaderSize> = sizeof(DIPROPHEADER).
  5184. *
  5185. * <e DIPROPHEADER.dwObj> = object identifier.
  5186. *
  5187. * <e DIPROPHEADER.dwHow> = how the <e DIPROPHEADER.dwObj>
  5188. * should be interpreted.
  5189. *
  5190. * @field LONG | lMin[5] |
  5191. *
  5192. * The lower limit of the object's ranges.
  5193. *
  5194. * @field LONG | lMax[5] |
  5195. *
  5196. * The upper limit of the object's ranges.
  5197. *
  5198. * @comm Although we only use four directions when calibrating POV, the extra entry
  5199. * is for the centered value which we may support in the future.
  5200. *
  5201. ****************************************************************************/
  5202. enddoc
  5203. typedef struct DIPROPCALPOV {
  5204. DIPROPHEADER diph;
  5205. LONG lMin[5];
  5206. LONG lMax[5];
  5207. } DIPROPCALPOV, *LPDIPROPCALPOV;
  5208. typedef const DIPROPCALPOV *LPCDIPROPCALPOV;
  5209. begindoc
  5210. /****************************************************************************
  5211. *
  5212. * @doc EXTERNAL
  5213. *
  5214. * @struct DIPROPGUIDANDPATH |
  5215. *
  5216. * Generic structure used to access properties whose values
  5217. * represent a GUID and path.
  5218. *
  5219. * @field DIPROPHEADER | diph |
  5220. *
  5221. * (IN) "Must" be preinitialized as follows:
  5222. *
  5223. * <e DIPROPHEADER.dwSize> = sizeof(DIPROPGUIDANDPATH).
  5224. *
  5225. * <e DIPROPHEADER.dwHeaderSize> = sizeof(DIPROPHEADER).
  5226. *
  5227. * <e DIPROPHEADER.dwObj> = object identifier.
  5228. *
  5229. * <e DIPROPHEADER.dwHow> = how the <e DIPROPHEADER.dwObj>
  5230. * should be interpreted.
  5231. *
  5232. * @field GUID | guidClass |
  5233. *
  5234. * The class GUID for the object.
  5235. *
  5236. * @field WCHAR | wszPath |
  5237. *
  5238. * The path for the object. Note that this is a UNICODE string.
  5239. *
  5240. ****************************************************************************/
  5241. enddoc
  5242. typedef struct DIPROPGUIDANDPATH {
  5243. DIPROPHEADER diph;
  5244. GUID guidClass;
  5245. WCHAR wszPath[MAX_PATH];
  5246. } DIPROPGUIDANDPATH, *LPDIPROPGUIDANDPATH;
  5247. typedef const DIPROPGUIDANDPATH *LPCDIPROPGUIDANDPATH;
  5248. begindoc
  5249. /****************************************************************************
  5250. *
  5251. * @doc EXTERNAL
  5252. *
  5253. * @struct DIPROPSTRING |
  5254. *
  5255. * Generic structure used to access properties whose values
  5256. * represent a string.
  5257. *
  5258. * @field DIPROPHEADER | diph |
  5259. *
  5260. * (IN) "Must" be preinitialized as follows:
  5261. *
  5262. * <e DIPROPHEADER.dwSize> = sizeof(DIPROPSTRING).
  5263. *
  5264. * <e DIPROPHEADER.dwHeaderSize> = sizeof(DIPROPHEADER).
  5265. *
  5266. * <e DIPROPHEADER.dwObj> = object identifier.
  5267. *
  5268. * <e DIPROPHEADER.dwHow> = how the <e DIPROPHEADER.dwObj>
  5269. * should be interpreted.
  5270. *
  5271. * @field WCHAR | wsz |
  5272. *
  5273. * The string itself. Note that this is a UNICODE string.
  5274. *
  5275. ****************************************************************************/
  5276. enddoc
  5277. typedef struct DIPROPSTRING {
  5278. DIPROPHEADER diph;
  5279. WCHAR wsz[MAX_PATH];
  5280. } DIPROPSTRING, *LPDIPROPSTRING;
  5281. typedef const DIPROPSTRING *LPCDIPROPSTRING;
  5282. ;end
  5283. ;begin_if_(DIRECTINPUT_VERSION)_800
  5284. #define MAXCPOINTSNUM 8
  5285. typedef struct _CPOINT
  5286. {
  5287. LONG lP; // raw value
  5288. DWORD dwLog; // logical_value / max_logical_value * 10000
  5289. } CPOINT, *PCPOINT;
  5290. typedef struct DIPROPCPOINTS {
  5291. DIPROPHEADER diph;
  5292. DWORD dwCPointsNum;
  5293. CPOINT cp[MAXCPOINTSNUM];
  5294. } DIPROPCPOINTS, *LPDIPROPCPOINTS;
  5295. typedef const DIPROPCPOINTS *LPCDIPROPCPOINTS;
  5296. ;end
  5297. ;begin_internal_800
  5298. begindoc
  5299. /****************************************************************************
  5300. *
  5301. * @doc INTERNAL
  5302. *
  5303. * @struct DIIMAGELABEL |
  5304. *
  5305. * Structure used to represent a string and associated display
  5306. * attributes.
  5307. *
  5308. * @field RECT | MaxStringExtent |
  5309. *
  5310. * Area into which a string may be drawn. The string is displayed
  5311. * relative to this rectangle in the manner described in the
  5312. * <e DIIMAGELABEL.dwFlags> field.
  5313. *
  5314. * @field DWORD | dwFlags |
  5315. *
  5316. * A combination of <c DIDAL_*> flags used to describe display
  5317. * attributes.
  5318. *
  5319. * @field POINT | Line[10] |
  5320. *
  5321. * Coordinates of points defining nine line segments to be drawn
  5322. * from the action to the label.
  5323. *
  5324. * @field DWORD | dwLineCount |
  5325. *
  5326. * Count of number of coordinates used in above array.
  5327. *
  5328. * @field WCHAR | wsz |
  5329. *
  5330. * The string itself. Note that this is a UNICODE string.
  5331. *
  5332. ****************************************************************************/
  5333. enddoc
  5334. typedef struct DIIMAGELABEL {
  5335. RECT MaxStringExtent;
  5336. DWORD dwFlags;
  5337. POINT Line[10];
  5338. DWORD dwLineCount;
  5339. WCHAR wsz[MAX_PATH];
  5340. } DIIMAGELABEL, *LPDIIMAGELABEL;
  5341. typedef const DIIMAGELABEL *LPCDIIMAGELABEL;
  5342. begindoc
  5343. /****************************************************************************
  5344. *
  5345. * @doc EXTERNAL
  5346. *
  5347. * @struct DIPROPGUID |
  5348. *
  5349. * Generic structure used to access GUID properties.
  5350. *
  5351. * @field DIPROPHEADER | diph |
  5352. *
  5353. * (IN) "Must" be preinitialized as follows:
  5354. *
  5355. * <e DIPROPHEADER.dwSize> = sizeof(DIPROPGUID).
  5356. *
  5357. * <e DIPROPHEADER.dwHeaderSize> = sizeof(DIPROPHEADER).
  5358. *
  5359. * <e DIPROPHEADER.dwObj> = object identifier.
  5360. *
  5361. * <e DIPROPHEADER.dwHow> = how the <e DIPROPHEADER.dwObj>
  5362. * should be interpreted.
  5363. *
  5364. * @field GUID | guid |
  5365. *
  5366. * On <f SetProperty>, contains the value of the property to
  5367. * be set. On <f GetProperty>, receives the value of the property.
  5368. *
  5369. ****************************************************************************/
  5370. enddoc
  5371. ;begin_if_(DIRECTINPUT_VERSION)_800
  5372. typedef struct DIPROPGUID {
  5373. DIPROPHEADER diph;
  5374. GUID guid;
  5375. } DIPROPGUID, *LPDIPROPGUID;
  5376. typedef const DIPROPGUID *LPCDIPROPGUID;
  5377. ;end
  5378. begindoc
  5379. /****************************************************************************
  5380. *
  5381. * @doc INTERNAL
  5382. *
  5383. * @struct DIPROPFILETIME |
  5384. *
  5385. * Not very generic structure used to access FILETIME properties.
  5386. *
  5387. * @field DIPROPHEADER | diph |
  5388. *
  5389. * (IN) "Must" be preinitialized as follows:
  5390. *
  5391. * <e DIPROPHEADER.dwSize> = sizeof(DIPROPFILETIME).
  5392. *
  5393. * <e DIPROPHEADER.dwHeaderSize> = sizeof(DIPROPHEADER).
  5394. *
  5395. * <e DIPROPHEADER.dwObj> = object identifier.
  5396. *
  5397. * <e DIPROPHEADER.dwHow> = how the <e DIPROPHEADER.dwObj>
  5398. * should be interpreted.
  5399. *
  5400. * @field GUID | guid |
  5401. *
  5402. * On <f SetProperty>, contains the value of the property to
  5403. * be set. On <f GetProperty>, receives the value of the property.
  5404. *
  5405. ****************************************************************************/
  5406. enddoc
  5407. ;begin_if_(DIRECTINPUT_VERSION)_800
  5408. typedef struct DIPROPFILETIME {
  5409. DIPROPHEADER diph;
  5410. FILETIME time;
  5411. } DIPROPFILETIME, *LPDIPROPFILETIME;
  5412. typedef const DIPROPFILETIME *LPCDIPROPFILETIME;
  5413. ;end
  5414. ;end_internal_800
  5415. begindoc
  5416. /****************************************************************************
  5417. *
  5418. * @doc EXTERNAL
  5419. *
  5420. * @func REFGUID | MAKEDIPROP |
  5421. *
  5422. * Helper macro which creates an integer property.
  5423. *
  5424. * Integer properties are defined by Microsoft. Vendors which
  5425. * wish to implement custom properties should use GUIDs.
  5426. *
  5427. * @parm int | prop |
  5428. *
  5429. * The integer property.
  5430. *
  5431. ****************************************************************************/
  5432. enddoc
  5433. #ifdef __cplusplus
  5434. #define MAKEDIPROP(prop) (*(const GUID *)(prop))
  5435. #else
  5436. #define MAKEDIPROP(prop) ((REFGUID)(prop))
  5437. #endif
  5438. begindoc
  5439. /****************************************************************************
  5440. *
  5441. * @doc EXTERNAL
  5442. *
  5443. * @define DIPROP_BUFFERSIZE | MAKEDIPROP(1) |
  5444. *
  5445. * Predefined property which sets or retrieves the device input
  5446. * buffer size.
  5447. * This setting applies to the entire device, rather
  5448. * than to any particular object, so the
  5449. * <e DIPROPHEADER.dwHow> field must be <c DIPH_DEVICE>.
  5450. *
  5451. * The <p pdiph> "must" be a
  5452. * pointer to the <e DIPROPDWORD.diph> member of a
  5453. * <t DIPROPDWORD> structure.
  5454. *
  5455. * The <e DIPROPDWORD.dwData> field may be set to zero to indicate
  5456. * that no buffering is requested.
  5457. *
  5458. * If the buffer size is too large to be supported by the device,
  5459. * then the largest possible buffer size is set.
  5460. *
  5461. * This property may not be altered while the device is acquired.
  5462. *
  5463. ****************************************************************************/
  5464. enddoc
  5465. #define DIPROP_BUFFERSIZE MAKEDIPROP(1)
  5466. begindoc
  5467. /****************************************************************************
  5468. *
  5469. * @doc EXTERNAL
  5470. *
  5471. * @define DIPROP_AXISMODE | MAKEDIPROP(2) |
  5472. *
  5473. * Predefined property which sets or retrieves the axis data
  5474. * mode. This setting applies to the entire device, rather
  5475. * than to any particular object, so the
  5476. * <e DIPROPHEADER.dwHow> field must be <c DIPH_DEVICE>.
  5477. *
  5478. * The <p pdiph> "must" be a
  5479. * pointer to the <e DIPROPDWORD.diph> member of a
  5480. * <t DIPROPDWORD> structure.
  5481. *
  5482. * The <e DIPROPDWORD.dwData> field may be one of the following
  5483. * values:
  5484. *
  5485. * <c DIPROPAXISMODE_ABS>: Report axis positions in "absolute
  5486. * coordinates". Axis motion accumulates over time.
  5487. *
  5488. * <c DIPROPAXISMODE_REL>: Report axis positions in "relative
  5489. * coordinates". Axis motion is reported as differences
  5490. * from the previous request for the axis position.
  5491. *
  5492. * This property may not be altered while the device is acquired.
  5493. *
  5494. ****************************************************************************/
  5495. enddoc
  5496. #define DIPROP_AXISMODE MAKEDIPROP(2)
  5497. #define DIPROPAXISMODE_ABS 0
  5498. #define DIPROPAXISMODE_REL 1
  5499. #define DIPROPAXISMODE_VALID 1 //;Internal
  5500. begindoc
  5501. /****************************************************************************
  5502. *
  5503. * @define DIPROP_GRANULARITY | MAKEDIPROP(3) |
  5504. *
  5505. * Predefined property which retrieves the granularity of the
  5506. * object.
  5507. *
  5508. * The <p pdiph> "must" be a
  5509. * pointer to the <e DIPROPDWORD.diph> member of a
  5510. * <t DIPROPDWORD> structure.
  5511. *
  5512. * The value of the granularity is the smallest
  5513. * distance the object will report movement. Most axis
  5514. * devices has a granularity of 1, meaning that all values
  5515. * are possible.
  5516. *
  5517. * Some axes may have a larger granularity.
  5518. * For example, the Z-wheel axis on a mouse may have a
  5519. * graularity of 20, meaning that all reported changes in
  5520. * position will be multiples of 20. In other words, when
  5521. * the user turns the Z-wheel slowly, the device reports
  5522. * a position of zero, then 20, then 40, etc.
  5523. *
  5524. * For a POV object, the granularity represents the increments
  5525. * by which the object reports directions. For example, a
  5526. * granularity of 9000 means that the device reports directions
  5527. * in multiples of 90 degrees.
  5528. *
  5529. * This is a read-only property.
  5530. *
  5531. ****************************************************************************/
  5532. enddoc
  5533. #define DIPROP_GRANULARITY MAKEDIPROP(3)
  5534. begindoc
  5535. /****************************************************************************
  5536. *
  5537. * @define DIPROP_RANGE | MAKEDIPROP(4) |
  5538. *
  5539. * Predefined property which retrieves the range of values
  5540. * reported by an object.
  5541. *
  5542. * The <p pdiph> "must" be a
  5543. * pointer to the <e DIPROPRANGE.diph> member of a
  5544. * <t DIPROPRANGE> structure.
  5545. *
  5546. * Not all objects permit their ranges to be altered.
  5547. * In particular, you can set the range of joystick axes,
  5548. * but not on mouse axes.
  5549. *
  5550. * This property may not be altered while the device is acquired.
  5551. *
  5552. * @devnote
  5553. *
  5554. * The ability to alter the range on a joystick axis
  5555. * is new for DX5.
  5556. *
  5557. *
  5558. ****************************************************************************/
  5559. enddoc
  5560. #define DIPROP_RANGE MAKEDIPROP(4)
  5561. ;begin_public_500
  5562. begindoc
  5563. /****************************************************************************
  5564. *
  5565. * @doc EXTERNAL
  5566. *
  5567. * @define DIPROP_DEADZONE | MAKEDIPROP(5) |
  5568. *
  5569. * Predefined property which accesses the dead zone for
  5570. * the object or device. Setting the dead zone for the
  5571. * entire device is equivalent to setting it for each
  5572. * axis individually.
  5573. *
  5574. * The <p pdiph> "must" be a
  5575. * pointer to the <e DIPROPDWORD.diph> member of a
  5576. * <t DIPROPDWORD> structure.
  5577. *
  5578. * You can set the dead zone property for all axes
  5579. * by setting the
  5580. * <e DIPROPHEADER.dwHow> field of the <t DIPROPHEADER>
  5581. * to <c DIPH_DEVICE> and the
  5582. * <e DIPROPHEADER.dwObj> field to zero.
  5583. *
  5584. * You can set the dead zone property for a particular
  5585. * axis by setting the
  5586. * <e DIPROPHEADER.dwHow> field of the <t DIPROPHEADER>
  5587. * to <c DIPH_BYID> or to <c DIPH_BYOFFSET> and setting
  5588. * the <e DIPROPHEADER.dwObj> field to the object id
  5589. * or offset (respectively).
  5590. *
  5591. * The <e DIPROPDWORD.dwData> field contains the dead zone
  5592. * for the object. The dead zone is a value in
  5593. * the range 0 through 10000, where 0 indicates that there
  5594. * is no dead zone and 10000 indicates that the entire
  5595. * physical range of the device is dead.
  5596. *
  5597. * Dead zones currently apply only to joystick devices.
  5598. * Analog joysticks typically do not center themselves
  5599. * consistently to the same value. As a result, a joystick
  5600. * which appears to be centered from the user's
  5601. * point of view may actually report a value slightly
  5602. * different from center.
  5603. *
  5604. * The dead zone is the region around the center position
  5605. * in which motion is ignored. For example, if the dead
  5606. * zone is set to 500, then the axis must move five percent
  5607. * from its center position before a motion will
  5608. * be reported. As long as the axis remains within the dead
  5609. * zone, the position is reported as equal to the center.
  5610. *
  5611. * Setting the dead zone to zero disables it.
  5612. *
  5613. * Each axis has an independent dead zone. For example,
  5614. * if a joystick controller represents both an X and a Y
  5615. * axis, and the user pushes the joystick directly forward,
  5616. * but not left/right, then the X axis dead zone will maintain
  5617. * the X coordinate as centered, even though the Y coordinate
  5618. * has change significantly. This behavior allows the user
  5619. * to (for example) move forward without slipping left or right.
  5620. *
  5621. * See the description of the <c DIPROP_SATURATION> property
  5622. * for a diagram that illustrates how the dead zone affects
  5623. * the values reported by DirectInput.
  5624. *
  5625. * This property may not be altered while the device is acquired.
  5626. *
  5627. * @devnote
  5628. *
  5629. * This is new for DX5.
  5630. *
  5631. ****************************************************************************/
  5632. enddoc
  5633. #define DIPROP_DEADZONE MAKEDIPROP(5)
  5634. begindoc
  5635. /****************************************************************************
  5636. *
  5637. * @doc EXTERNAL
  5638. *
  5639. * @define DIPROP_SATURATION | MAKEDIPROP(6) |
  5640. *
  5641. * Predefined property which accesses the saturation level for
  5642. * the object or device. Setting the saturation for the
  5643. * entire device is equivalent to setting it for each
  5644. * axis individually.
  5645. *
  5646. * The <p pdiph> "must" be a
  5647. * pointer to the <e DIPROPDWORD.diph> member of a
  5648. * <t DIPROPDWORD> structure.
  5649. *
  5650. * You can set the saturation property for all axes
  5651. * by setting the
  5652. * <e DIPROPHEADER.dwHow> field of the <t DIPROPHEADER>
  5653. * to <c DIPH_DEVICE> and the
  5654. * <e DIPROPHEADER.dwObj> field to zero.
  5655. *
  5656. * You can set the saturation property for a particular
  5657. * axis by setting the
  5658. * <e DIPROPHEADER.dwHow> field of the <t DIPROPHEADER>
  5659. * to <c DIPH_BYID> or to <c DIPH_BYOFFSET> and setting
  5660. * the <e DIPROPHEADER.dwObj> field to the object id
  5661. * or offset (respectively).
  5662. *
  5663. * The <e DIPROPDWORD.dwData> field contains the saturation level
  5664. * for the object. The saturation level is a value in
  5665. * the range 0 through 10000.
  5666. *
  5667. * Saturation levels currently apply only to joystick devices.
  5668. * Analog joysticks typically have problems reporting the full
  5669. * range of values. For example, a joystick's X axis may
  5670. * report "full left" only when the joystick is moved to the
  5671. * upper left corner. If moved to the lower left corner,
  5672. * it may report a value that is slightly above the minimum
  5673. * value the axis putatively reports.
  5674. *
  5675. * The saturation level is the point at which the position of
  5676. * the axis is considered to be at its most extreme position.
  5677. * For example, if the saturation level is set to 9500,
  5678. * then once the axis moves 95 percent of the distance from
  5679. * its center position to its extreme position, the reported
  5680. * value will be its extreme position.
  5681. *
  5682. * Setting the saturation level to 10000 disables it.
  5683. *
  5684. * The saturation level must be greater than the dead zone
  5685. * for the combined effect to be meaningful.
  5686. *
  5687. * Each axis has an independent saturation level.
  5688. *
  5689. * This property may not be altered while the device is acquired.
  5690. *
  5691. * @ex The following crude diagram (not to scale)
  5692. * illustrates the combined effects of a dead zone and
  5693. * a saturation level.
  5694. *
  5695. * The vertical axis shows the values returned by DirectInput.
  5696. * "min" and "max" are the axis range minimum and maximum values.
  5697. * "ctr" is the axis center position.
  5698. *
  5699. * The horizontal axis represents the physical axis position.
  5700. * "dmin" and "dmax" are the minimum and maximum ranges of
  5701. * the dead zone, while "smin" and "smax" are the lower and
  5702. * upper saturation levels. "pmin" and "pmax" are the
  5703. * physical range
  5704. * of the axis. pctr" is the axis physical center position.
  5705. *
  5706. *
  5707. *
  5708. * |
  5709. *
  5710. * . |
  5711. * . max- *----*
  5712. * . r | /
  5713. * . e | /
  5714. * . t | /
  5715. * . u ctr- *------*
  5716. * . r | /
  5717. * . n | /
  5718. * . e | /
  5719. * . d min- *----*
  5720. * . |
  5721. * . +-|----|---|---|--|---|----|--
  5722. * . pmin smin dmin |dmax smax pmax
  5723. * . |
  5724. * . pctr
  5725. * .
  5726. * . physical position
  5727. *
  5728. *
  5729. * @devnote
  5730. *
  5731. * This is new for DX5.
  5732. *
  5733. ****************************************************************************/
  5734. enddoc
  5735. #define DIPROP_SATURATION MAKEDIPROP(6)
  5736. begindoc
  5737. /****************************************************************************
  5738. *
  5739. * @doc EXTERNAL
  5740. *
  5741. * @define DIPROP_FFGAIN | MAKEDIPROP(7) |
  5742. *
  5743. * Predefined property which accesses the gain setting for
  5744. * the device.
  5745. * This setting applies to the entire device, rather
  5746. * than to any particular object, so the
  5747. * <e DIPROPHEADER.dwHow> field must be <c DIPH_DEVICE>.
  5748. *
  5749. * The <p pdiph> "must" be a
  5750. * pointer to the <e DIPROPDWORD.diph> member of a
  5751. * <t DIPROPDWORD> structure.
  5752. *
  5753. * The <e DIPROPDWORD.dwData> field contains a gain value
  5754. * that is applied to all effects created on the device.
  5755. * The value is an integer in the range 0 to 10,000,
  5756. * specifying the amount by which effect magnitudes should
  5757. * be scaled for the device.
  5758. *
  5759. * For example, a value of 10,000 indicates that
  5760. * all effect magnitudes are to be taken at face value.
  5761. * A value of 9,000 indicates that all effect magnitudes
  5762. * are to be reduced to 90% of their nominal magnitudes.
  5763. *
  5764. * Setting a gain value is useful when an application
  5765. * wishes to scale down the strength of all force feedback
  5766. * effects uniformly, based on user preferences.
  5767. *
  5768. * Note that the DirectInput control panel can specify
  5769. * a system-wide device gain which is applied in addition
  5770. * to the gain specified by the <c DIPROP_FFGAIN> property.
  5771. *
  5772. * For example, if the DirectInput control panel has set
  5773. * the system-wide device gain to 50%, and the application
  5774. * sets the device gain to 9000 (90%), then effects
  5775. * will be played at 45% of their nominal magnitudes.
  5776. *
  5777. * ISSUE-2001/03/29-timgill feature spec wrong
  5778. * DirectInput control panel doesn't do this yet.
  5779. *
  5780. * @devnote
  5781. *
  5782. * This is new for DX5.
  5783. *
  5784. ****************************************************************************/
  5785. /*
  5786. * @doc INTERNAL
  5787. *
  5788. * @func BOOL | ISVALIDGAIN |
  5789. *
  5790. * Internal macro used to validate that a gain value is
  5791. * nominally valid. Although technically the value must
  5792. * lie in the range 0 to 10,000, we actually allow it to
  5793. * go as high as 65535 ("overgain") for devices which
  5794. * want to be able to magnify effects as well as damp them.
  5795. *
  5796. * The value of 65535 is very special, because we need
  5797. * to combine two gain values into a single gain, and
  5798. * <f MulDiv> doesn't like it when the result of the
  5799. * operation doesn't fit into 32 bits.
  5800. *
  5801. * @parm DWORD | dwGain |
  5802. *
  5803. * The gain value to check.
  5804. *
  5805. ****************************************************************************/
  5806. enddoc
  5807. #define DIPROP_FFGAIN MAKEDIPROP(7)
  5808. #define ISVALIDGAIN(n) (HIWORD(n) == 0) ;internal
  5809. begindoc
  5810. /****************************************************************************
  5811. *
  5812. * @doc EXTERNAL
  5813. *
  5814. * @define DIPROP_FFLOAD | MAKEDIPROP(8) |
  5815. *
  5816. * Predefined property which accesses the memory load for
  5817. * the device.
  5818. * This setting applies to the entire device, rather
  5819. * than to any particular object, so the
  5820. * <e DIPROPHEADER.dwHow> field must be <c DIPH_DEVICE>.
  5821. *
  5822. * The <p pdiph> "must" be a
  5823. * pointer to the <e DIPROPDWORD.diph> member of a
  5824. * <t DIPROPDWORD> structure.
  5825. *
  5826. * The <e DIPROPDWORD.dwData> field contains a value
  5827. * in the range 0 to 100, indicating the amount of
  5828. * device memory in use (in percent).
  5829. * A value of 0 means
  5830. * that the device memory is all available;
  5831. * a value of 100 means that the device is full.
  5832. *
  5833. * @devnote
  5834. *
  5835. * This is new for DX5.
  5836. *
  5837. ****************************************************************************/
  5838. enddoc
  5839. #define DIPROP_FFLOAD MAKEDIPROP(8)
  5840. begindoc
  5841. /****************************************************************************
  5842. *
  5843. * @doc EXTERNAL
  5844. *
  5845. * @define DIPROP_AUTOCENTER | MAKEDIPROP(9) |
  5846. *
  5847. * Predefined property which allows the application to
  5848. * specify whether device objects are self-centering.
  5849. * This setting applies to the entire device, rather
  5850. * than to any particular object, so the
  5851. * <e DIPROPHEADER.dwHow> field must be <c DIPH_DEVICE>.
  5852. *
  5853. * The <p pdiph> "must" be a
  5854. * pointer to the <e DIPROPDWORD.diph> member of a
  5855. * <t DIPROPDWORD> structure.
  5856. *
  5857. * The <e DIPROPDWORD.dwData> field may be one of the following
  5858. * values:
  5859. *
  5860. * <c DIPROPAUTOCENTER_OFF>: The device should not
  5861. * automatically center when the user releases the
  5862. * device. An application that uses force-feedback
  5863. * should disable the auto-centering spring before
  5864. * playing effects.
  5865. *
  5866. * <c DIPROPAUTOCENTER_ON>: The device should automatically
  5867. * center when the user releases the device. For example,
  5868. * in this mode, a joystick would engage the self-centering
  5869. * spring.
  5870. *
  5871. * Note that the use of force feedback effects may
  5872. * interfere with the auto-centering spring. Some
  5873. * devices disable the auto-centering spring when
  5874. * a force-feedback effect is played.
  5875. *
  5876. * Note that not all devices support the auto-center property.
  5877. *
  5878. * @devnote
  5879. *
  5880. * This is new for DX5.
  5881. *
  5882. ****************************************************************************/
  5883. enddoc
  5884. #define DIPROP_AUTOCENTER MAKEDIPROP(9)
  5885. #define DIPROPAUTOCENTER_OFF 0
  5886. #define DIPROPAUTOCENTER_ON 1
  5887. #define DIPROPAUTOCENTER_VALID 1 ;internal
  5888. begindoc
  5889. /****************************************************************************
  5890. *
  5891. * @doc EXTERNAL
  5892. *
  5893. * @define DIPROP_CALIBRATIONMODE | MAKEDIPROP(10) |
  5894. *
  5895. * Predefined property which allows the application to
  5896. * specify whether DirectInput should retrieve calibrated
  5897. * or uncalibrated data from an axis. By default,
  5898. * DirectInput retrieves
  5899. * calibrated data. Control panel-type applications may
  5900. * need to retrieve raw (uncalibrated) data.
  5901. *
  5902. * Setting the calibration mode for the entire device
  5903. * is equivalent to setting it for each axis individually.
  5904. *
  5905. * The <p pdiph> "must" be a
  5906. * pointer to the <e DIPROPDWORD.diph> member of a
  5907. * <t DIPROPDWORD> structure.
  5908. *
  5909. * You can set the calibration mode property for all axes
  5910. * by setting the
  5911. * <e DIPROPHEADER.dwHow> field of the <t DIPROPHEADER>
  5912. * to <c DIPH_DEVICE> and the
  5913. * <e DIPROPHEADER.dwObj> field to zero.
  5914. *
  5915. * You can set the calibration mode property for a particular
  5916. * axis by setting the
  5917. * <e DIPROPHEADER.dwHow> field of the <t DIPROPHEADER>
  5918. * to <c DIPH_BYID> or to <c DIPH_BYOFFSET> and setting
  5919. * the <e DIPROPHEADER.dwObj> field to the object id
  5920. * or offset (respectively).
  5921. *
  5922. * The <e DIPROPDWORD.dwData> field may be one of the following
  5923. * values:
  5924. *
  5925. * <c DIPROPCALIBRATIONMODE_COOKED>: DirectInput should
  5926. * return data after applying calibration information.
  5927. * This is the default mode.
  5928. *
  5929. * <c DIPROPCALIBRATIONMODE_RAW>: DirectInput should
  5930. * return raw, uncalibrated data. This mode is typically
  5931. * used only by control panel-type applications.
  5932. *
  5933. * Note that setting a device into "raw" mode causes the
  5934. * dead zone, saturation, and range settings to
  5935. * be ignored.
  5936. *
  5937. * @devnote
  5938. *
  5939. * This is new for DX5.
  5940. *
  5941. ****************************************************************************/
  5942. enddoc
  5943. #define DIPROP_CALIBRATIONMODE MAKEDIPROP(10)
  5944. #define DIPROPCALIBRATIONMODE_COOKED 0
  5945. #define DIPROPCALIBRATIONMODE_RAW 1
  5946. #define DIPROPCALIBRATIONMODE_VALID 1 ;internal
  5947. ;end_public_500
  5948. ;begin_if_(DIRECTINPUT_VERSION)_50A
  5949. begindoc
  5950. /****************************************************************************
  5951. *
  5952. * @doc EXTERNAL
  5953. *
  5954. * @define DIPROP_CALIBRATION | MAKEDIPROP(11) |
  5955. *
  5956. * Predefined property which allows the application to
  5957. * access the information that DirectInput uses to
  5958. * manipulate axes which require calibration.
  5959. *
  5960. * This property exists primarily for control panel-type
  5961. * applications. Normal applications should have no need
  5962. * to deal with calibration information.
  5963. *
  5964. * The <p pdiph> "must" be a
  5965. * pointer to the <e DIPROPCAL.diph> member of a
  5966. * <t DIPROPCAL> structure.
  5967. *
  5968. * You can access the calibration mode property for a particular
  5969. * axis by setting the
  5970. * <e DIPROPHEADER.dwHow> field of the <t DIPROPHEADER>
  5971. * to <c DIPH_BYID> or to <c DIPH_BYOFFSET> and setting
  5972. * the <e DIPROPHEADER.dwObj> field to the object id
  5973. * or offset (respectively).
  5974. *
  5975. * Control panel applications which set new calibration data
  5976. * must also invoke the <mf IDirectInputJoyConfig::SendNotify>
  5977. * method to notify other applications of the change in
  5978. * calibration.
  5979. *
  5980. * @devnote
  5981. *
  5982. * The <c DIPROP_CALIBRATION> property is new for DirectX 5.0a
  5983. *
  5984. ****************************************************************************/
  5985. enddoc
  5986. #define DIPROP_CALIBRATION MAKEDIPROP(11)
  5987. begindoc
  5988. /****************************************************************************
  5989. *
  5990. * @doc EXTERNAL
  5991. *
  5992. * @define DIPROP_GUIDANDPATH | MAKEDIPROP(12) |
  5993. *
  5994. * Predefined property which allows the application to
  5995. * access the class GUID and device interface (path)
  5996. * for the device.
  5997. *
  5998. * This property exists for advanced applications
  5999. * which wish to perform operations on the device
  6000. * which are not supported by DirectInput.
  6001. * The application can call <f CreateFile> on the
  6002. * returned path in order to access the device
  6003. * directly. If an application chooses to go this
  6004. * route, it is the responsibility of the application
  6005. * to manage the device properly.
  6006. *
  6007. * Normal applications should have no need
  6008. * to access the device directly.
  6009. *
  6010. * This property applies to the entire device, rather
  6011. * than to any particular object, so the
  6012. * <e DIPROPHEADER.dwHow> field must be <c DIPH_DEVICE>.
  6013. *
  6014. * The <p pdiph> "must" be a
  6015. * pointer to the <e DIPROPGUIDANDPATH.diph> member of a
  6016. * <t DIPROPHEADER> structure.
  6017. *
  6018. * @devnote
  6019. *
  6020. * The <c DIPROP_GUIDANDPATH> property is new for DirectX 5.0a
  6021. *
  6022. ****************************************************************************/
  6023. enddoc
  6024. #define DIPROP_GUIDANDPATH MAKEDIPROP(12)
  6025. begindoc
  6026. /****************************************************************************
  6027. *
  6028. * @doc EXTERNAL
  6029. *
  6030. * @define DIPROP_INSTANCENAME | MAKEDIPROP(13) |
  6031. *
  6032. * Predefined property which allows the application to
  6033. * access the instance friendly name returned in the
  6034. * <t DIDEVICEINSTANCE> structure's
  6035. * <e DIDEVICEINSTANCE.tszInstanceName> field.
  6036. *
  6037. * This property exists for advanced applications
  6038. * which wish to change the friendly name of a device
  6039. * in order better to distinguish it from similar
  6040. * devices which are plugged in simultaneously.
  6041. *
  6042. * Normal applications should have no need
  6043. * to change the device friendly name.
  6044. * Normal applications can retrieve the friendly name
  6045. * with the <mf IDirectInputDevice::GetDeviceInfo> method.
  6046. *
  6047. * This property applies to the entire device, rather
  6048. * than to any particular object, so the
  6049. * <e DIPROPHEADER.dwHow> field must be <c DIPH_DEVICE>.
  6050. *
  6051. * The <p pdiph> "must" be a
  6052. * pointer to the <e DIPROPSTRING.diph> member of a
  6053. * <t DIPROPSTRING> structure.
  6054. *
  6055. * @devnote
  6056. *
  6057. * The <c DIPROP_INSTANCENAME> property is new for DirectX 5.0a
  6058. *
  6059. ****************************************************************************/
  6060. enddoc
  6061. #define DIPROP_INSTANCENAME MAKEDIPROP(13)
  6062. begindoc
  6063. /****************************************************************************
  6064. *
  6065. * @doc EXTERNAL
  6066. *
  6067. * @define DIPROP_PRODUCTNAME | MAKEDIPROP(14) |
  6068. *
  6069. * Predefined property which allows the application to
  6070. * access the product friendly name returned in the
  6071. * <t DIDEVICEINSTANCE> structure's
  6072. * <e DIDEVICEINSTANCE.tszProductName> field.
  6073. *
  6074. * This property exists for advanced applications
  6075. * which wish to change the friendly name of a device
  6076. * in order better to distinguish it from similar
  6077. * devices which are plugged in simultaneously.
  6078. *
  6079. * Normal applications should have no need
  6080. * to change the product name.
  6081. * Normal applications can retrieve the product name
  6082. * with the <mf IDirectInputDevice::GetDeviceInfo> method.
  6083. *
  6084. * This property applies to the entire device, rather
  6085. * than to any particular object, so the
  6086. * <e DIPROPHEADER.dwHow> field must be <c DIPH_DEVICE>.
  6087. *
  6088. * The <p pdiph> "must" be a
  6089. * pointer to the <e DIPROPSTRING.diph> member of a
  6090. * <t DIPROPSTRING> structure.
  6091. *
  6092. * @devnote
  6093. *
  6094. * The <c DIPROP_PRODUCTNAME> property is new for DirectX 5.0a
  6095. *
  6096. ****************************************************************************/
  6097. enddoc
  6098. #define DIPROP_PRODUCTNAME MAKEDIPROP(14)
  6099. ;end
  6100. ;begin_if_(DIRECTINPUT_VERSION)_5B2
  6101. begindoc
  6102. /****************************************************************************
  6103. *
  6104. * @doc EXTERNAL
  6105. *
  6106. * @define DIPROP_JOYSTICKID | MAKEDIPROP(15) |
  6107. *
  6108. * Predefined property which retrieves the device's
  6109. * joystick ID.
  6110. * This setting applies to the entire device, rather
  6111. * than to any particular object, so the
  6112. * <e DIPROPHEADER.dwHow> field must be <c DIPH_DEVICE>.
  6113. *
  6114. * The <p pdiph> "must" be a
  6115. * pointer to the <e DIPROPDWORD.diph> member of a
  6116. * <t DIPROPDWORD> structure.
  6117. *
  6118. *
  6119. * @devnote
  6120. *
  6121. * The <c DIPROP_JOYSTICKID> property is new for DirectX 6.1a
  6122. *
  6123. ****************************************************************************/
  6124. enddoc
  6125. #define DIPROP_JOYSTICKID MAKEDIPROP(15)
  6126. begindoc
  6127. /****************************************************************************
  6128. *
  6129. * @doc EXTERNAL
  6130. *
  6131. * @define DIPROP_GETPORTDISPLAYNAME | MAKEDIPROP(16) |
  6132. *
  6133. * Predefined property which retrieves the display name of the
  6134. * port that the device is connected to.
  6135. * This setting applies to the entire device, rather
  6136. * than to any particular object, so the
  6137. * <e DIPROPHEADER.dwHow> field must be <c DIPH_DEVICE>.
  6138. *
  6139. * The <p pdiph> "must" be a
  6140. * pointer to the <e DIPROPSTRING.diph> member of a
  6141. * <t DIPROPSTRING> structure.
  6142. *
  6143. * @devnote
  6144. *
  6145. * The <c DIPROP_GETPORTDISPLAYNAME> property is new for DirectX 6.1a
  6146. *
  6147. ****************************************************************************/
  6148. enddoc
  6149. #define DIPROP_GETPORTDISPLAYNAME MAKEDIPROP(16)
  6150. begindoc
  6151. /****************************************************************************
  6152. *
  6153. * @doc INTERNAL
  6154. *
  6155. * @define DIPROP_ENABLEREPORTID | MAKEDIPROP(17) |
  6156. *
  6157. * @devnote
  6158. * <y This property has been made internal>
  6159. * <y This property was only supported in Win98 SE and DX7>
  6160. * The property should not be reassigned.
  6161. * The internal version of the property is documented elsewhere.
  6162. *
  6163. ****************************************************************************/
  6164. enddoc
  6165. ;end
  6166. ;begin_if_(DIRECTINPUT_VERSION)_700
  6167. begindoc
  6168. /****************************************************************************
  6169. *
  6170. * @doc EXTERNAL
  6171. *
  6172. * @define DIPROP_PHYSICALRANGE | MAKEDIPROP(18) |
  6173. *
  6174. * Predefined property which retrieves the physical range
  6175. * reported by an object.
  6176. *
  6177. * The <p pdiph> "must" be a
  6178. * pointer to the <e DIPROPRANGE.diph> member of a
  6179. * <t DIPROPRANGE> structure.
  6180. *
  6181. * Physical ranges can't be altered.
  6182. *
  6183. * @devnote
  6184. *
  6185. * The ability to get the physical range on a joystick axis
  6186. * is new for DX7.
  6187. *
  6188. *
  6189. ****************************************************************************/
  6190. enddoc
  6191. #define DIPROP_PHYSICALRANGE MAKEDIPROP(18)
  6192. begindoc
  6193. /****************************************************************************
  6194. *
  6195. * @doc EXTERNAL
  6196. *
  6197. * @define DIPROP_LOGICALRANGE | MAKEDIPROP(19) |
  6198. *
  6199. * Predefined property which retrieves the logical range
  6200. * reported by an object.
  6201. *
  6202. * The <p pdiph> "must" be a
  6203. * pointer to the <e DIPROPRANGE.diph> member of a
  6204. * <t DIPROPRANGE> structure.
  6205. *
  6206. * Logical ranges can't be altered.
  6207. *
  6208. * @devnote
  6209. *
  6210. * The ability to get the logical range on a joystick axis
  6211. * is new for DX7.
  6212. *
  6213. *
  6214. ****************************************************************************/
  6215. enddoc
  6216. #define DIPROP_LOGICALRANGE MAKEDIPROP(19)
  6217. ;end
  6218. ;begin_if_(DIRECTINPUT_VERSION)_800
  6219. begindoc
  6220. /****************************************************************************
  6221. *
  6222. * @doc EXTERNAL
  6223. *
  6224. * @define DIPROP_KEYNAME | MAKEDIPROP(20) |
  6225. *
  6226. * Predefined property which retrieves the text name of a key on keyboard
  6227. *
  6228. * The <p pdiph> "must" be a
  6229. * pointer to the <e DIPROPSTRING.diph> member of a
  6230. * <t DIPROPSTRING> structure.
  6231. *
  6232. * Key name can't be altered.
  6233. *
  6234. * @devnote
  6235. *
  6236. * The ability to get the key text name is new for DX8.
  6237. *
  6238. * This property is only applied to object, not device.
  6239. * If dwHow == DIPH_DEVICE, E_INVALIDARG will be returned.
  6240. *
  6241. *
  6242. ****************************************************************************/
  6243. enddoc
  6244. #define DIPROP_KEYNAME MAKEDIPROP(20)
  6245. begindoc
  6246. /****************************************************************************
  6247. *
  6248. * @define DIPROP_CPOINTS | MAKEDIPROP(21) |
  6249. *
  6250. * Get/Set the control points for calibration.
  6251. *
  6252. * The <p pdiph> "must" be a
  6253. * pointer to the <e DIPROPCPOINTS.diph> member of a
  6254. * <t DIPROPCPOINTS> structure.
  6255. *
  6256. * @devnote
  6257. *
  6258. * The ability to set/get for calibration.
  6259. * New for Dinput8.
  6260. *
  6261. *
  6262. ****************************************************************************/
  6263. enddoc
  6264. #define DIPROP_CPOINTS MAKEDIPROP(21)
  6265. begindoc
  6266. /****************************************************************************
  6267. *
  6268. * @doc EXTERNAL
  6269. *
  6270. * @define DIPROP_APPDATA | MAKEDIPROP(22) |
  6271. *
  6272. * Predefined property which sets or retrieves the application data
  6273. * associated with an object on a device.
  6274. * An object which is not included in the current data format does
  6275. * not have application data so this property cannot be accessed.
  6276. *
  6277. * The <p pdiph> "must" be a pointer to the <e DIPROPPOINTER.diph>
  6278. * member of a <t DIPROPPOINTER> structure.
  6279. *
  6280. * This property may not be altered while the device is acquired.
  6281. *
  6282. ****************************************************************************/
  6283. enddoc
  6284. #define DIPROP_APPDATA MAKEDIPROP(22)
  6285. begindoc
  6286. /****************************************************************************
  6287. * @doc EXTERNAL
  6288. *
  6289. * @define DIPROP_SCANCODE | MAKEDIPROP(23) |
  6290. *
  6291. * Predefined object property which retrieves the PS/2 scan code
  6292. * associated with or a keyboard key object.
  6293. * Note, if the keyboard is a HID keyboard, the scan code retrieved
  6294. * is the PS/2 equivalent of the HID usage for the object.
  6295. *
  6296. * The <p pdiph> "must" be a pointer to the <e DIPROPDWORD.diph>
  6297. * member of a <t DIPROPDWORD> structure.
  6298. *
  6299. * @devnote
  6300. *
  6301. * This property is only applied to object, not device.
  6302. * If dwHow == DIPH_DEVICE, E_INVALIDARG will be returned.
  6303. *
  6304. ****************************************************************************/
  6305. enddoc
  6306. #define DIPROP_SCANCODE MAKEDIPROP(23)
  6307. begindoc
  6308. /****************************************************************************
  6309. *
  6310. * @doc EXTERNAL
  6311. *
  6312. * @define DIPROP_VIDPID | MAKEDIPROP(24) |
  6313. *
  6314. * Predefined read-only device property which retrieves the vendor
  6315. * ID and product ID of a HID device.
  6316. *
  6317. * These two WORD values are combined in the <e DIPROPDWORD.dwData>
  6318. * field so the values should be extracted as follows
  6319. * wVendorID = LOWORD( <e DIPROPDWORD.dwData> );
  6320. * wProductID = HIWORD( <e DIPROPDWORD.dwData> );
  6321. *
  6322. * This property applies to the entire device, rather
  6323. * than to any particular object, so the
  6324. * <e DIPROPHEADER.dwHow> field must be <c DIPH_DEVICE>.
  6325. *
  6326. * The <p pdiph> "must" be a pointer to the <e DIPROPDWORD.diph>
  6327. * member of a <t DIPROPDWORD> structure.
  6328. *
  6329. ****************************************************************************/
  6330. enddoc
  6331. #define DIPROP_VIDPID MAKEDIPROP(24)
  6332. begindoc
  6333. /****************************************************************************
  6334. *
  6335. * @doc EXTERNAL
  6336. *
  6337. * @define DIPROP_USERNAME | MAKEDIPROP(25) |
  6338. *
  6339. * Predefined property which retrieves the name of the user
  6340. * currently using the device.
  6341. * This setting applies to the entire device, rather
  6342. * than to any particular object, so the
  6343. * <e DIPROPHEADER.dwHow> field must be <c DIPH_DEVICE>.
  6344. *
  6345. * The <p pdiph> "must" be a
  6346. * pointer to the <e DIPROPSTRING.diph> member of a
  6347. * <t DIPROPSTRING> structure.
  6348. *
  6349. * @devnote
  6350. *
  6351. * The <c DIPROP_USERNAME> property is new for DirectX 8
  6352. *
  6353. ****************************************************************************/
  6354. enddoc
  6355. #define DIPROP_USERNAME MAKEDIPROP(25)
  6356. begindoc
  6357. /****************************************************************************
  6358. *
  6359. * @doc EXTERNAL
  6360. *
  6361. * @define DIPROP_TYPENAME | MAKEDIPROP(26) |
  6362. *
  6363. * Predefined property which retrieves the type name of a device.
  6364. * For most game controllers this is the registry key name under
  6365. * <c REGSTR_PATH_JOYOEM> from which static device settings may be
  6366. * retrieved but predefined joystick types have special names
  6367. * consisting of a "#" character followed by a character dependent
  6368. * upon the type.
  6369. * This value may not be available for all devices.
  6370. * This setting applies to the entire device, rather than to any
  6371. * particular object, so the <e DIPROPHEADER.dwHow> field must be
  6372. * <c DIPH_DEVICE>.
  6373. *
  6374. * The <p pdiph> "must" be a pointer to the <e DIPROPSTRING.diph>
  6375. * member of a <t DIPROPSTRING> structure.
  6376. *
  6377. *
  6378. * @devnote
  6379. *
  6380. * The <c DIPROP_TYPENAME> property is new for DirectX 8
  6381. *
  6382. ****************************************************************************/
  6383. enddoc
  6384. #define DIPROP_TYPENAME MAKEDIPROP(26)
  6385. ;end
  6386. ;begin_internal_800
  6387. begindoc
  6388. /****************************************************************************
  6389. *
  6390. * @doc INTERNAL
  6391. *
  6392. * @define DIPROP_ENABLEREPORTID | MAKEDIPROP(0xFFFB) |
  6393. *
  6394. * <y Undocumented> predefined property which enables/disables
  6395. * HID features/outputs associated with the
  6396. * elements specified by the previous
  6397. * <mf IDirectInput::SetDataFormat>.
  6398. *
  6399. * The <p pdiph> "must" be a
  6400. * pointer to the <e DIPROPDWORD.diph> member of a
  6401. * <t DIPROPDWORD> structure.
  6402. *
  6403. * If <e DIPROPHEADER.dwHow> is <c DIPH_DEVICE>,
  6404. * <e DIPROPDWORD.dipdw> can be set to
  6405. * 0x0 to disable polling of all report IDs contained
  6406. * contained in the previous call to <mf IDirectInput::SetDataFormat>.
  6407. *
  6408. * 0x1 to enable polling of all report IDs.
  6409. *
  6410. * If <e DIPROPHEADER.dwHow> is not <c DIPH_DEVICE> and pertains to
  6411. * individual elements within the specified data format,
  6412. * <e DIPROPDWORD.dipdw> can be set to
  6413. * 0xFFFFFFFF to disable all output(s)/feature(s) that use
  6414. * the same report ID.
  6415. * 0x0 to disable polling of report ID associated with the feature/output
  6416. * ,only if all other feature(s)/output(s) that use the same report ID have
  6417. * also been disabled.
  6418. *
  6419. * 0x1 to enable polling of HID report ID associated with the feature/output.
  6420. *
  6421. * By default, Dinput will only poll for reportIds that are referenced by
  6422. * elements in the previous <mf IDirectInput::SetDataFormat>.
  6423. *
  6424. * @devnote
  6425. *
  6426. * The <c DIPROP_ENABLESETREPORTID> property is new for DirectX 6.1a
  6427. *
  6428. ****************************************************************************/
  6429. enddoc
  6430. #define DIPROP_ENABLEREPORTID MAKEDIPROP(0xFFFB)
  6431. // now unused, may be replaced DIPROP_IMAGEFILE MAKEDIPROP(0xFFFC) ;internal
  6432. begindoc
  6433. /****************************************************************************
  6434. *
  6435. * @doc INTERNAL
  6436. *
  6437. * @define DIPROP_MAPFILE | MAKEDIPROP(0xFFFD) |
  6438. *
  6439. * <y Undocumented> predefined property which is used to get a
  6440. * fully qualified file name for the hardware manufacturer supplied
  6441. * default semantic map for the device.
  6442. *
  6443. * This setting applies to the entire device, rather than to any
  6444. * particular object, so the <e DIPROPHEADER.dwHow> field
  6445. * must be <c DIPH_DEVICE>.
  6446. *
  6447. * The <p pdiph> "must" be a pointer to the <e DIPROPSTRING.diph>
  6448. * member of a <t DIPROPSTRING> structure.
  6449. *
  6450. * @devnote
  6451. *
  6452. * The <c DIPROP_MAPFILE> property is new for DirectX 8.
  6453. *
  6454. ****************************************************************************/
  6455. enddoc
  6456. #define DIPROP_MAPFILE MAKEDIPROP(0xFFFD)//;Internal
  6457. ;end_internal_800
  6458. begindoc
  6459. /****************************************************************************
  6460. *
  6461. * @doc INTERNAL
  6462. *
  6463. * @define DIPROP_SPECIFICCALIBRATION | MAKEDIPROP(0xFFFE) |
  6464. *
  6465. * <y Undocumented> predefined property which acts the same
  6466. * as <c DIPROP_CALIBRATION>, except that the resulting change
  6467. * to the calibration is not propagated to any alias devices.
  6468. *
  6469. * By default, changing the calibration of one device
  6470. * also changes the calibration of all its aliases,
  6471. * and changing the calibration of an alias updates
  6472. * the calibration of its referent.
  6473. *
  6474. * When a device is munging the calibration of an alias,
  6475. * it uses this property instead of the regular
  6476. * <c DIPROP_CALIBRATION> property, so as to avoid
  6477. * infinite recursion death as each device keeps trying
  6478. * to update the other.
  6479. *
  6480. * Also, the units of a specific calibration are always
  6481. * the VJOYD-calibration values.
  6482. *
  6483. ****************************************************************************/
  6484. enddoc
  6485. #define DIPROP_SPECIFICCALIBRATION MAKEDIPROP(0xFFFE)//;Internal
  6486. ;internal
  6487. begindoc
  6488. /****************************************************************************
  6489. *
  6490. * @doc INTERNAL
  6491. *
  6492. * @define DIPROP_MAXBUFFERSIZE | MAKEDIPROP(0xFFFF) |
  6493. *
  6494. * <y Undocumented> predefined property which accesses the
  6495. * maximum allowable buffer size for the device.
  6496. *
  6497. * It exists as a back-door in case somebody comes up with
  6498. * an application that needs a really huge buffer size.
  6499. * (The current maximum is 1023.)
  6500. *
  6501. * This property may not be altered while the device is acquired.
  6502. *
  6503. * Warning: The value of this property was originally 5
  6504. * in DX3. But nobody has needed it, so I'm moving it
  6505. * to 0xFFFF to keep it out of the way.
  6506. *
  6507. ****************************************************************************/
  6508. enddoc
  6509. #define DIPROP_MAXBUFFERSIZE MAKEDIPROP(0xFFFF) //;Internal
  6510. ;internal
  6511. #define DEVICE_MAXBUFFERSIZE 1023 //;internal
  6512. begindoc
  6513. /****************************************************************************
  6514. *
  6515. * @doc EXTERNAL
  6516. *
  6517. * @struct DIDEVICEOBJECTDATA |
  6518. *
  6519. * The <t DIDEVICEOBJECTDATA> structure is used by the
  6520. * <mf IDirectInputDevice::GetDeviceData> method
  6521. * to return raw buffered device information.
  6522. *
  6523. * @field DWORD | dwOfs |
  6524. *
  6525. * Offset into the current data format of the object
  6526. * whose data is being reported. In other words, the
  6527. * location where the <e DIDEVICEOBJECTDATA.dwData>
  6528. * would have been stored if the data had been obtained via
  6529. * <mf IDirectInputDevice::GetDeviceState>.
  6530. *
  6531. * For the predefined data formats, the
  6532. * <e DIDEVICEOBJECTDATA.dwOfs> field will be as follows:
  6533. *
  6534. * If the device is accessed as a mouse, it will be one
  6535. * of the <c DIMOFS_*> values.
  6536. *
  6537. * If the device is accessed as a keyboard, it will be one
  6538. * of the <c DIK_*> values.
  6539. *
  6540. ;begin_public_500
  6541. * If the device is accessed as a joystick, it will be one
  6542. * of the <c DIJOFS_*> values.
  6543. ;end_public_500
  6544. * @field DWORD | dwData |
  6545. *
  6546. * The data obtained from the device. The format of this
  6547. * data depends on the type of the device, but in all cases,
  6548. * the data is reported in raw form.
  6549. *
  6550. * <c DIDFT_AXIS>: If the device is in relative axis mode,
  6551. * then the relative axis motion is reported. If the device
  6552. * is in absolute axis mode, then the absolute axis coordinate
  6553. * is reported.
  6554. *
  6555. * <c DIDFT_BUTTON>: Only the low byte of the
  6556. * <e DIDEVICEOBJECTDATA.dwData> is significant.
  6557. * The high bit of the low byte is set if the button
  6558. * went down; it is clear if the button went up.
  6559. *
  6560. * <c DIDFT_POV>: The direction in which the user is
  6561. * pressing the device.
  6562. *
  6563. * @field DWORD | dwTimeStamp |
  6564. *
  6565. * Tick count in milliseconds at which the event was generated.
  6566. * The current system tick count can be obtained by calling the
  6567. * <f GetTickCount> system function. Remember that this value
  6568. * wraps around approximately every 50 days.
  6569. *
  6570. * @field DWORD | dwSequence |
  6571. *
  6572. * DirectInput sequence number for this event. All DirectInput
  6573. * events are assigned an increasing sequence number.
  6574. * This allows events from different devices to be sorted
  6575. * chronologically. Since this value can wrap around, care must
  6576. * be taken when comparing two sequence numbers. The
  6577. * <f DISEQUENCE_COMPARE> macro can be used to perform this
  6578. * comparison safely.
  6579. *
  6580. ;begin_public_800
  6581. * @field UINT_PTR | uAppData |
  6582. *
  6583. * Identifier supplied by an application for this object
  6584. * in the latest <mf IDirectInputDevice8::SetActionMap> call.
  6585. *
  6586. *
  6587. * @comm DIDEVICEOBJECTDATA_DX3 is defined to allow applications which
  6588. * need to use the original structure to do so.
  6589. ;end_public_800
  6590. *
  6591. * @func BOOL | DISEQUENCE_COMPARE |
  6592. *
  6593. * Macro which compares two DirectInput sequence numbers,
  6594. * compensating for wraparound.
  6595. *
  6596. * @parm DWORD | dwSequence1 |
  6597. *
  6598. * First sequence number to compare.
  6599. *
  6600. * @parm operator | cmp |
  6601. *
  6602. * One of the following comparison operators:
  6603. * "==", "!=", "<lt>", "<gt>", "<lt>=", "<gt>=".
  6604. *
  6605. * @parm DWORD | dwSequence2 |
  6606. *
  6607. * Second sequence number to compare.
  6608. *
  6609. * @returns
  6610. *
  6611. * Returns a nonzero value iff the first sequence number is
  6612. * equal to, is not equal to, chronologically precedes,
  6613. * chronologically follows, chronologically precedes or is
  6614. * equal to, or chronologically follows or is
  6615. * equal to the second sequence number.
  6616. *
  6617. * @ex
  6618. *
  6619. * The following example checks whether <p dwSequence1>
  6620. * precedes <p dwSequence2> chronologically:
  6621. *
  6622. * |
  6623. *
  6624. * if (DISEQUENCE_COMPARE(dwSequence1, <, dwSequence2)) {
  6625. * ...
  6626. * }
  6627. *
  6628. * @ex
  6629. *
  6630. * The following example checks whether <p dwSequence1>
  6631. * chronologically follows or is equal to <p dwSequence2>:
  6632. *
  6633. * |
  6634. *
  6635. * if (DISEQUENCE_COMPARE(dwSequence1, >=, dwSequence2)) {
  6636. * ...
  6637. * }
  6638. *
  6639. ****************************************************************************/
  6640. enddoc
  6641. ;begin_public_800
  6642. typedef struct DIDEVICEOBJECTDATA_DX3 {
  6643. DWORD dwOfs;
  6644. DWORD dwData;
  6645. DWORD dwTimeStamp;
  6646. DWORD dwSequence;
  6647. } DIDEVICEOBJECTDATA_DX3, *LPDIDEVICEOBJECTDATA_DX3;
  6648. typedef const DIDEVICEOBJECTDATA_DX3 *LPCDIDEVICEOBJECTDATA_DX;
  6649. ;end_public_800
  6650. typedef struct DIDEVICEOBJECTDATA {
  6651. DWORD dwOfs;
  6652. DWORD dwData;
  6653. DWORD dwTimeStamp;
  6654. DWORD dwSequence;
  6655. ;begin_if_(DIRECTINPUT_VERSION)_800
  6656. UINT_PTR uAppData;
  6657. ;end
  6658. } DIDEVICEOBJECTDATA, *LPDIDEVICEOBJECTDATA;
  6659. typedef const DIDEVICEOBJECTDATA *LPCDIDEVICEOBJECTDATA;
  6660. #define DIGDD_PEEK 0x00000001
  6661. #define DIGDD_RESIDUAL 0x00000002 //;Internal
  6662. #define DIGDD_VALID 0x00000003 //;Internal
  6663. #define DISEQUENCE_COMPARE(dwSequence1, cmp, dwSequence2) \
  6664. ((int)((dwSequence1) - (dwSequence2)) cmp 0)
  6665. begindoc
  6666. /****************************************************************************
  6667. *
  6668. * @doc EXTERNAL
  6669. *
  6670. * @define DISCL_EXCLUSIVE | 0x00000001 |
  6671. *
  6672. * Parameter to <f SetCooperativeLevel> to indicate that
  6673. * exclusive access is desired.
  6674. * If exclusive access is granted, then no other instance of
  6675. * of the device
  6676. * may obtain exclusive access to the device while it is
  6677. * acquired. Note, however, that non-exclusive access to the device
  6678. * is always permitted, even if another application has
  6679. * obtained exclusive access. (The word "exclusive" is a bit
  6680. * of a misnomer here, but it is employed to parallel a similar
  6681. * concept in DirectDraw.)
  6682. *
  6683. * It is strongly recommended that an application which acquires
  6684. * the mouse or keyboard device in exclusive mode unacquire
  6685. * the devices upon receipt
  6686. * of <c WM_ENTERSIZEMOVE> and <c WM_ENTERMENULOOP> messages;
  6687. * otherwise, the user will not be able to manipulate the menu
  6688. * or move or resize the window.
  6689. *
  6690. * Exactly one of <c DISCL_EXCLUSIVE> or <c DISCL_NONEXCLUSIVE>
  6691. * must be passed to <f SetCooperativeLevel>. "It is an error"
  6692. * to pass both or neither.
  6693. *
  6694. * In the current version of DirectInput,
  6695. * exclusive access requires foreground access.
  6696. *
  6697. * @define DISCL_NONEXCLUSIVE | 0x00000002 |
  6698. *
  6699. * Parameter to <f SetCooperativeLevel> to indicate that
  6700. * non-exclusive access is desired. Access to the device will
  6701. * not interfere with other applications which are accessing
  6702. * the same device.
  6703. *
  6704. * Exactly one of <c DISCL_EXCLUSIVE> or <c DISCL_NONEXCLUSIVE>
  6705. * must be passed to <f SetCooperativeLevel>. "It is an error"
  6706. * to pass both or neither.
  6707. *
  6708. * @define DISCL_FOREGROUND | 0x00000004 |
  6709. *
  6710. * Parameter to <f SetCooperativeLevel> to indicate that
  6711. * foreground access is desired.
  6712. * If foreground access is granted, then the device is
  6713. * automatically unacquired when the associated window
  6714. * loses foreground activation.
  6715. *
  6716. * Exactly one of <c DISCL_FOREGROUND> or <c DISCL_BACKGROUND>
  6717. * must be passed to <f SetCooperativeLevel>. "It is an error"
  6718. * to pass both or neither.
  6719. *
  6720. * @define DISCL_BACKGROUND | 0x00000008 |
  6721. *
  6722. * Parameter to <f SetCooperativeLevel> to indicate that
  6723. * background access is desired.
  6724. * If background access is granted, then the device may
  6725. * be acquired at any time, even when the associated window
  6726. * is not the active window.
  6727. *
  6728. * Exactly one of <c DISCL_FOREGROUND> or <c DISCL_BACKGROUND>
  6729. * must be passed to <f SetCooperativeLevel>. "It is an error"
  6730. * to pass both or neither.
  6731. *
  6732. * @define DISCL_NOWINKEY | 0x00000010 |
  6733. *
  6734. * Parameter to <f SetCooperativeLevel> to indicate that
  6735. * Window Keys (LWIN and RWIN) are disable.
  6736. *
  6737. * Exclusive Foreground mode already disables the Window Keys.
  6738. * It is only useful in NoExclusive mode.
  6739. *
  6740. * Note that the current version of DirectInput does not
  6741. * permit exclusive background access.
  6742. *
  6743. ****************************************************************************/
  6744. enddoc
  6745. #define DISCL_EXCLUSIVE 0x00000001
  6746. #define DISCL_NONEXCLUSIVE 0x00000002
  6747. #define DISCL_EXCLMASK 0x00000003 //;Internal
  6748. #define DISCL_FOREGROUND 0x00000004
  6749. #define DISCL_BACKGROUND 0x00000008
  6750. #define DISCL_NOWINKEY 0x00000010
  6751. #define DISCL_GROUNDMASK 0x0000000C //;Internal
  6752. #define DISCL_VALID 0x0000001F //;Internal
  6753. begindoc
  6754. /****************************************************************************
  6755. *
  6756. * @doc EXTERNAL
  6757. *
  6758. * @struct DIDEVICEINSTANCE |
  6759. *
  6760. * The <t DIDEVICEINSTANCE> structure is used by the
  6761. * <mf IDirectInput::EnumDevices> and
  6762. * <mf IDirectInputDevice::GetDeviceInfo> methods
  6763. * to return information about a particular device instance.
  6764. *
  6765. * @field IN DWORD | dwSize |
  6766. *
  6767. * The size of the structure in bytes.
  6768. *
  6769. * @field IN GUID | guidInstance |
  6770. *
  6771. * Unique identifier which identifies the instance of the device.
  6772. * An application may save the instance GUID into a configuration
  6773. * file and use it at a later time. Instance GUIDs are specific
  6774. * to a particular machine. An instance GUID obtained from one
  6775. * machine is unrelated to instance GUIDs on another machine.
  6776. *
  6777. * @field IN GUID | guidProduct |
  6778. *
  6779. * Unique identifier which identifies the product.
  6780. * This identifier is established by the manufacturer of the
  6781. * device.
  6782. *
  6783. * @field IN DWORD | dwDevType |
  6784. *
  6785. * Device type specifier. Se the section titled
  6786. * "DirectInput device type description codes"
  6787. * for a description of this field.
  6788. *
  6789. * @field IN TCHAR | tszInstanceName[MAX_PATH] |
  6790. *
  6791. * Friendly name for the instance. For example, "Joystick 1".
  6792. *
  6793. * @field IN TCHAR | tszProductName[MAX_PATH] |
  6794. *
  6795. * Friendly name for the product. For example,
  6796. * "Frobozz Industries SuperStick 5X"
  6797. *
  6798. * @field GUID | guidFFDriver |
  6799. *
  6800. * Unique identifier which identifies the the driver being
  6801. * used for force feedback. This identifier is established
  6802. * by the manufacturer of the force feedback driver.
  6803. *
  6804. * This field is new for DirectX 5.0.
  6805. *
  6806. * @field WORD | wUsagePage |
  6807. *
  6808. * If the device is a HID device, then this field contains the
  6809. * HID usage page code. See the hidusage.h
  6810. * header file for a list of usage pages.
  6811. *
  6812. * This field is new for DirectX 5.0.
  6813. *
  6814. * @field WORD | wUsage |
  6815. *
  6816. * If the device is a HID device, then this field contains the
  6817. * HID usage code. See the hidusage.h
  6818. * header file for a list of usages.
  6819. *
  6820. * This field is new for DirectX 5.0.
  6821. *
  6822. * @field LPDIRECTINPUTDEVICE | lpDiDev |
  6823. *
  6824. * Device interface pointer.
  6825. *
  6826. * This field is new for DirectX 8.
  6827. *
  6828. ****************************************************************************/
  6829. enddoc
  6830. ;begin_if_(DIRECTINPUT_VERSION)_500
  6831. /* These structures are defined for DirectX 3.0 compatibility */
  6832. typedef struct DIDEVICEINSTANCE_DX3% {
  6833. DWORD dwSize;
  6834. GUID guidInstance;
  6835. GUID guidProduct;
  6836. DWORD dwDevType;
  6837. TCHAR% tszInstanceName[MAX_PATH];
  6838. TCHAR% tszProductName[MAX_PATH];
  6839. } DIDEVICEINSTANCE_DX3%, *LPDIDEVICEINSTANCE_DX3%;
  6840. typedef const DIDEVICEINSTANCE_DX3A *LPCDIDEVICEINSTANCE_DX3A;
  6841. typedef const DIDEVICEINSTANCE_DX3W *LPCDIDEVICEINSTANCE_DX3W;
  6842. typedef const DIDEVICEINSTANCE_DX3 *LPCDIDEVICEINSTANCE_DX3;
  6843. ;end
  6844. typedef struct DIDEVICEINSTANCE% {
  6845. DWORD dwSize;
  6846. GUID guidInstance;
  6847. GUID guidProduct;
  6848. DWORD dwDevType;
  6849. TCHAR% tszInstanceName[MAX_PATH];
  6850. TCHAR% tszProductName[MAX_PATH];
  6851. ;begin_if_(DIRECTINPUT_VERSION)_500
  6852. GUID guidFFDriver;
  6853. WORD wUsagePage;
  6854. WORD wUsage;
  6855. ;end
  6856. } DIDEVICEINSTANCE%, *LPDIDEVICEINSTANCE%;
  6857. typedef const DIDEVICEINSTANCE% *LPCDIDEVICEINSTANCE%;
  6858. typedef const DIDEVICEINSTANCE *LPCDIDEVICEINSTANCE;
  6859. ;begin_internal_500
  6860. /*
  6861. * Name for the 5.0 structure, in places where we specifically care.
  6862. */
  6863. typedef DIDEVICEINSTANCE% DIDEVICEINSTANCE_DX5%;
  6864. typedef DIDEVICEINSTANCE DIDEVICEINSTANCE_DX5;
  6865. typedef DIDEVICEINSTANCE% *LPDIDEVICEINSTANCE_DX5%;
  6866. typedef DIDEVICEINSTANCE *LPDIDEVICEINSTANCE_DX5;
  6867. typedef const DIDEVICEINSTANCE% *LPCDIDEVICEINSTANCE_DX5%;
  6868. typedef const DIDEVICEINSTANCE *LPCDIDEVICEINSTANCE_DX5;
  6869. BOOL static __inline
  6870. IsValidSizeDIDEVICEINSTANCEW(DWORD cb)
  6871. {
  6872. return cb == sizeof(DIDEVICEINSTANCE_DX5W) ||
  6873. cb == sizeof(DIDEVICEINSTANCE_DX3W);
  6874. }
  6875. BOOL static __inline
  6876. IsValidSizeDIDEVICEINSTANCEA(DWORD cb)
  6877. {
  6878. return cb == sizeof(DIDEVICEINSTANCE_DX5A) ||
  6879. cb == sizeof(DIDEVICEINSTANCE_DX3A);
  6880. }
  6881. ;end_internal_500
  6882. begindoc
  6883. /****************************************************************************
  6884. *
  6885. * @doc INTERNAL
  6886. *
  6887. * @define DIRCP_MODAL | 0x00000001 |
  6888. *
  6889. * Parameter to <f RunControlPanel> to indicate that
  6890. * the control panel should be displayed modally. (I.e.,
  6891. * that the method should not return until the user has exited
  6892. * the control panel.)
  6893. *
  6894. * The default is to display the control panel non-modally.
  6895. *
  6896. * In the current version of DirectInput,
  6897. * modal control panels are not supported.
  6898. *
  6899. ****************************************************************************/
  6900. enddoc
  6901. #define DIRCP_MODAL 0x00000001 //;Internal
  6902. #define DIRCP_VALID 0x00000000 //;Internal
  6903. ;internal
  6904. begin_interface(IDirectInputDevice%)
  6905. begin_methods()
  6906. declare_method(GetCapabilities, LPDIDEVCAPS)
  6907. declare_method(EnumObjects, LPDIENUMDEVICEOBJECTSCALLBACK%, LPVOID, DWORD)
  6908. declare_method(GetProperty, REFGUID, LPDIPROPHEADER)
  6909. declare_method(SetProperty, REFGUID, LPCDIPROPHEADER)
  6910. declare_method(Acquire)
  6911. declare_method(Unacquire)
  6912. declare_method(GetDeviceState, DWORD, LPVOID)
  6913. declare_method(GetDeviceData, DWORD, LPDIDEVICEOBJECTDATA, LPDWORD, DWORD)
  6914. declare_method(SetDataFormat, LPCDIDATAFORMAT)
  6915. declare_method(SetEventNotification, HANDLE)
  6916. declare_method(SetCooperativeLevel, HWND, DWORD)
  6917. declare_method(GetObjectInfo,LPDIDEVICEOBJECTINSTANCE%,DWORD,DWORD)
  6918. declare_method(GetDeviceInfo,LPDIDEVICEINSTANCE%)
  6919. declare_method(RunControlPanel, HWND, DWORD)
  6920. declare_method(Initialize, HINSTANCE, DWORD, REFGUID)
  6921. end_methods()
  6922. end_interface()
  6923. #endif /* DIJ_RINGZERO */
  6924. begindoc
  6925. /****************************************************************************
  6926. *
  6927. * IDirectInputDevice2
  6928. *
  6929. ****************************************************************************/
  6930. enddoc
  6931. ;begin_if_(DIRECTINPUT_VERSION)_500
  6932. begindoc
  6933. /****************************************************************************
  6934. *
  6935. * @doc EXTERNAL
  6936. *
  6937. * @define DISFFC_RESET | 0x00000001 |
  6938. *
  6939. * Parameter to <mf IDirectInputDevice2::SendForceFeedbackCommand>
  6940. * which indicates that
  6941. * playback of any active effects should be been stopped
  6942. * and that all effects should be removed from the device.
  6943. * Once the device has been reset, all effects are no longer
  6944. * valid and must be re-created.
  6945. *
  6946. * @define DISFFC_STOPALL | 0x00000002 |
  6947. *
  6948. * Parameter to <mf IDirectInputDevice2::SendForceFeedbackCommand>
  6949. * to indicate that
  6950. * playback of all effects should be stopped.
  6951. * Sending the <c DISFFC_STOPALL> command is equivalent
  6952. * to invoking the <mf IDirectInputEffect::Stop> method
  6953. * on all effects that are playing.
  6954. *
  6955. * If the device is in a paused state, sending this command
  6956. * cause the paused state to be lost.
  6957. *
  6958. * @define DISFFC_PAUSE | 0x00000004 |
  6959. *
  6960. * Parameter to <mf IDirectInputDevice2::SendForceFeedbackCommand>
  6961. * to indicate that
  6962. * playback of all effects should be paused.
  6963. *
  6964. * When effects are paused, time "stops" until the
  6965. * <c DISFFC_CONTINUE> command is sent.
  6966. * For example, suppose an effect of five seconds' duration
  6967. * is started. After one second, effects are paused.
  6968. * After two more seconds, effects are continued.
  6969. * The effect will then play for four additional seconds.
  6970. *
  6971. * Note that while a force feedback device is paused,
  6972. * you may not start a new effect or modify existing ones.
  6973. * Doing so may result
  6974. * in the subsequent <c DISFFC_CONTINUE> failing to perform
  6975. * properly.
  6976. *
  6977. * If you wish to abandon a pause (rather than continue it),
  6978. * send the <c DISFFC_STOPALL> or <c DISFFC_RESET> command.
  6979. *
  6980. * @define DISFFC_CONTINUE | 0x00000008 |
  6981. *
  6982. * Parameter to <mf IDirectInputDevice2::SendForceFeedbackCommand>
  6983. * to indicate that
  6984. * effects whose playback was interrupt by a previous
  6985. * <c DISFFC_PAUSE> command should be resumed at the point
  6986. * at which they were interrupted.
  6987. *
  6988. * It is an error to send a <c DISFFC_CONTINUE> command
  6989. * when the device is not in a paused state.
  6990. *
  6991. * @define DISFFC_SETACTUATORSON | 0x00000010 |
  6992. *
  6993. * Parameter to <mf IDirectInputDevice2::SendForceFeedbackCommand>
  6994. * to indicate that the
  6995. * device's force feedback actuators should be enabled.
  6996. *
  6997. * @define DISFFC_SETACTUATORSOFF | 0x00000020 |
  6998. *
  6999. * Parameter to <mf IDirectInputDevice2::SendForceFeedbackCommand>
  7000. * to indicate that the
  7001. * device's force feedback actuators should be disabled.
  7002. * If successful, force feedback effects are "muted".
  7003. *
  7004. * Note that while actuators are off, time still continues
  7005. * to elapse.
  7006. * For example, suppose an effect of five seconds' duration
  7007. * is started. After one second, actuators are turned off.
  7008. * After two more seconds, actuators are turned back on.
  7009. * The effect will then play for two additional seconds.
  7010. *
  7011. ****************************************************************************/
  7012. enddoc
  7013. #define DISFFC_NULL 0x00000000;internal
  7014. #define DISFFC_RESET 0x00000001
  7015. #define DISFFC_STOPALL 0x00000002
  7016. #define DISFFC_PAUSE 0x00000004
  7017. #define DISFFC_CONTINUE 0x00000008
  7018. #define DISFFC_SETACTUATORSON 0x00000010
  7019. #define DISFFC_SETACTUATORSOFF 0x00000020
  7020. #define DISFFC_VALID 0x0000003F;internal
  7021. #define DISFFC_FORCERESET 0x80000000;internal
  7022. begindoc
  7023. /****************************************************************************
  7024. *
  7025. * @doc EXTERNAL
  7026. *
  7027. * @define DIGFFS_EMPTY | 0x00000001 |
  7028. *
  7029. * Flag returned by <mf IDirectInputDevice2::GetForceFeedbackState>
  7030. * which indicates that
  7031. * the force feedback device is devoid of any downloaded effects.
  7032. *
  7033. * @define DIGFFS_STOPPED | 0x00000002 |
  7034. *
  7035. * Flag returned by <mf IDirectInputDevice2::GetForceFeedbackState>
  7036. * to indicate that
  7037. * no effects are currently playing and the device is not paused.
  7038. *
  7039. * @define DIGFFS_PAUSED | 0x00000004 |
  7040. *
  7041. * Flag returned by <mf IDirectInputDevice2::GetForceFeedbackState>
  7042. * to indicate that
  7043. * playback of effects has been paused by a previous
  7044. * <c DISFFC_PAUSE> command.
  7045. *
  7046. * @define DIGFFS_ACTUATORSON | 0x00000010 |
  7047. *
  7048. * Flag returned by <mf IDirectInputDevice2::GetForceFeedbackState>
  7049. * to indicate that the
  7050. * device's force feedback actuators are enabled.
  7051. *
  7052. * @define DIGFFS_ACTUATORSOFF | 0x00000020 |
  7053. *
  7054. * Flag returned by <mf IDirectInputDevice2::GetForceFeedbackState>
  7055. * to indicate that the
  7056. * device's force feedback actuators are disabled.
  7057. *
  7058. * @define DIGFFS_POWERON | 0x00000040 |
  7059. *
  7060. * Flag returned by <mf IDirectInputDevice2::GetForceFeedbackState>
  7061. * to indicate that
  7062. * power to the force feedback system is currently available.
  7063. * If the device cannot report the power state,
  7064. * then neither <c DIGFFS_POWERON> nor <c DIGFFS_POWEROFF>
  7065. * will be returned.
  7066. *
  7067. * @define DIGFFS_POWEROFF | 0x00000080 |
  7068. *
  7069. * Flag returned by <mf IDirectInputDevice2::GetForceFeedbackState>
  7070. * to indicate that
  7071. * power to the force feedback system is not currently available.
  7072. * If the device cannot report the power state,
  7073. * then neither <c DIGFFS_POWERON> nor <c DIGFFS_POWEROFF>
  7074. * will be returned.
  7075. *
  7076. * @define DIGFFS_SAFETYSWITCHON | 0x00000100 |
  7077. *
  7078. * Flag returned by <mf IDirectInputDevice2::GetForceFeedbackState>
  7079. * to indicate that
  7080. * the safety switch (dead man switch) is currently on,
  7081. * meaning that the device can operate.
  7082. * If the device cannot report the state of the safety switch,
  7083. * then neither <c DIGFFS_SAFETYSWITCHON> nor
  7084. * <c DIGFFS_SAFETYSWITCHOFF>
  7085. * will be returned.
  7086. *
  7087. * @define DIGFFS_SAFETYSWITCHOFF | 0x00000200 |
  7088. *
  7089. * Flag returned by <mf IDirectInputDevice2::GetForceFeedbackState>
  7090. * to indicate that
  7091. * the safety switch (dead man switch) is currently off,
  7092. * meaning that the device cannot operate.
  7093. * If the device cannot report the state of the safety switch,
  7094. * then neither <c DIGFFS_SAFETYSWITCHON> nor
  7095. * <c DIGFFS_SAFETYSWITCHOFF>
  7096. * will be returned.
  7097. *
  7098. * @define DIGFFS_USERFFSWITCHON | 0x00000400 |
  7099. *
  7100. * Flag returned by <mf IDirectInputDevice2::GetForceFeedbackState>
  7101. * to indicate that
  7102. * the user force feedback switch is currently on,
  7103. * meaning that the device can operate.
  7104. * If the device cannot report the state of the
  7105. * user force feedback switch,
  7106. * then neither <c DIGFFS_USERFFSWITCHON> nor
  7107. * <c DIGFFS_USERFFSWITCHOFF>
  7108. * will be returned.
  7109. *
  7110. * @define DIGFFS_USERFFSWITCHOFF | 0x00000800 |
  7111. *
  7112. * Flag returned by <mf IDirectInputDevice2::GetForceFeedbackState>
  7113. * to indicate that
  7114. * the user force feedback switch is currently off,
  7115. * meaning that the device cannot operate.
  7116. * If the device cannot report the state of the
  7117. * user force feedback switch,
  7118. * then neither <c DIGFFS_USERFFSWITCHON> nor
  7119. * <c DIGFFS_USERFFSWITCHOFF>
  7120. * will be returned.
  7121. *
  7122. * @define DIGFFS_DEVICELOST | 0x80000000 |
  7123. *
  7124. * Flag returned by <mf IDirectInputDevice2::GetForceFeedbackState>
  7125. * to indicate that
  7126. * the device suffered an unexpected failure and is in an
  7127. * indeterminate state.
  7128. * It must be reset either by unacquiring and reacquiring
  7129. * the device, or by explicitly sending a
  7130. * <c DISFFC_RESET> command.
  7131. *
  7132. * For example, the device may be lost if the user suspends
  7133. * the computer, causing
  7134. * on-board memory on the device may have been lost.
  7135. *
  7136. ****************************************************************************/
  7137. enddoc
  7138. #define DIGFFS_EMPTY 0x00000001
  7139. #define DIGFFS_STOPPED 0x00000002
  7140. #define DIGFFS_PAUSED 0x00000004
  7141. #define DIGFFS_ACTUATORSON 0x00000010
  7142. #define DIGFFS_ACTUATORSOFF 0x00000020
  7143. #define DIGFFS_POWERON 0x00000040
  7144. #define DIGFFS_POWEROFF 0x00000080
  7145. #define DIGFFS_SAFETYSWITCHON 0x00000100
  7146. #define DIGFFS_SAFETYSWITCHOFF 0x00000200
  7147. #define DIGFFS_USERFFSWITCHON 0x00000400
  7148. #define DIGFFS_USERFFSWITCHOFF 0x00000800
  7149. #define DIGFFS_DEVICELOST 0x80000000
  7150. #define DIGFFS_RANDOM 0x40000000;internal_500
  7151. #ifndef DIJ_RINGZERO
  7152. begindoc
  7153. /****************************************************************************
  7154. *
  7155. * @doc EXTERNAL
  7156. *
  7157. * @struct DIEFFECTINFO |
  7158. *
  7159. * The <t DIEFFECTINFO> structure is used by the
  7160. * <mf IDirectInputDevice2::EnumEffects> and
  7161. * <mf IDirectInputDevice2::GetEffectInfo> methods
  7162. * to return information about a particular effect on a device.
  7163. *
  7164. * @field DWORD | dwSize |
  7165. *
  7166. * The size of the structure in bytes. The application may
  7167. * inspect this value to determine how many fields of the
  7168. * structure are valid. For DirectInput 5.0, the value will
  7169. * be sizeof(DIEFFECTINFO). Future versions of
  7170. * DirectInput may return a larger structure.
  7171. *
  7172. * @field GUID | guid |
  7173. *
  7174. * Identifies the effect.
  7175. *
  7176. * @field DWORD | dwEffType |
  7177. *
  7178. * Zero or more <c DIEFT_*> values describing the effect.
  7179. *
  7180. * See "DirectInput Effect Format Types" for a description
  7181. * of how the flags should be interpreted.
  7182. *
  7183. * @field DWORD | dwStaticParams |
  7184. *
  7185. * Zero or more <c DIEP_*> values describing the
  7186. * parameters supported by the effect. For example,
  7187. * if <c DIEP_ENVELOPE> is set, then the effect
  7188. * supports an envelope.
  7189. *
  7190. * It is not an error for an application to attempt to use
  7191. * effect parameters which are not supported by the device.
  7192. * The unsupported parameters are merely ignored.
  7193. *
  7194. * This information is provided to allow the application
  7195. * to tailor its use of force feedback to the capabilities
  7196. * of the specific device.
  7197. *
  7198. * @field DWORD | dwDynamicParams |
  7199. *
  7200. * Zero or more <c DIEP_*> values describing the
  7201. * parameters of the effect which can be modified
  7202. * while the effect is playing.
  7203. *
  7204. * If an application attempts to change a parameter
  7205. * while the effect is playing, and the driver does not
  7206. * support modifying that effect dynamically, then
  7207. * the status code <c DIERR_EFFECTPLAYING> will be returned.
  7208. *
  7209. * This information is provided to allow the application
  7210. * to tailor its use of force feedback to the capabilities
  7211. * of the specific device.
  7212. *
  7213. * @field TCHAR | tszName[MAX_PATH] |
  7214. *
  7215. * Name of the effect. For example, "Sawtooth Up"
  7216. * or "Constant force".
  7217. *
  7218. ****************************************************************************/
  7219. enddoc
  7220. typedef struct DIEFFECTINFO% {
  7221. DWORD dwSize;
  7222. GUID guid;
  7223. DWORD dwEffType;
  7224. DWORD dwStaticParams;
  7225. DWORD dwDynamicParams;
  7226. TCHAR% tszName[MAX_PATH];
  7227. } DIEFFECTINFO%, *LPDIEFFECTINFO%;
  7228. typedef const DIEFFECTINFOA *LPCDIEFFECTINFOA;
  7229. typedef const DIEFFECTINFOW *LPCDIEFFECTINFOW;
  7230. typedef const DIEFFECTINFO *LPCDIEFFECTINFO;
  7231. begindoc
  7232. /****************************************************************************
  7233. *
  7234. * @doc EXTERNAL
  7235. *
  7236. * @define DISDD_CONTINUE | 0x00000001 |
  7237. *
  7238. * Flag for <mf IDirectInputDevice2::SendDeviceData>
  7239. * which indicates that
  7240. * the device data sent will be overlaid upon the previously
  7241. * sent device data. Otherwise, the device data sent
  7242. * will start from an empty device state.
  7243. *
  7244. ****************************************************************************/
  7245. enddoc
  7246. #define DISDD_CONTINUE 0x00000001
  7247. #define DISDD_VALID 0x00000001;internal_500
  7248. typedef BOOL (FAR PASCAL * LPDIENUMEFFECTSCALLBACK%)(LPCDIEFFECTINFO%, LPVOID);
  7249. typedef BOOL (FAR PASCAL * LPDIENUMCREATEDEFFECTOBJECTSCALLBACK)(LPDIRECTINPUTEFFECT, LPVOID);
  7250. #define DIECEFL_VALID 0x00000000;internal
  7251. begin_interface(IDirectInputDevice2%, IDirectInputDevice%)
  7252. begin_methods()
  7253. declare_method(GetCapabilities, LPDIDEVCAPS)
  7254. declare_method(EnumObjects, LPDIENUMDEVICEOBJECTSCALLBACK%, LPVOID, DWORD)
  7255. declare_method(GetProperty, REFGUID, LPDIPROPHEADER)
  7256. declare_method(SetProperty, REFGUID, LPCDIPROPHEADER)
  7257. declare_method(Acquire)
  7258. declare_method(Unacquire)
  7259. declare_method(GetDeviceState, DWORD, LPVOID)
  7260. declare_method(GetDeviceData, DWORD, LPDIDEVICEOBJECTDATA, LPDWORD, DWORD)
  7261. declare_method(SetDataFormat, LPCDIDATAFORMAT)
  7262. declare_method(SetEventNotification, HANDLE)
  7263. declare_method(SetCooperativeLevel, HWND, DWORD)
  7264. declare_method(GetObjectInfo,LPDIDEVICEOBJECTINSTANCE%,DWORD,DWORD)
  7265. declare_method(GetDeviceInfo,LPDIDEVICEINSTANCE%)
  7266. declare_method(RunControlPanel, HWND, DWORD)
  7267. declare_method(Initialize, HINSTANCE, DWORD, REFGUID)
  7268. end_base_class_methods()
  7269. declare_method(CreateEffect, REFGUID, LPCDIEFFECT, LPDIRECTINPUTEFFECT *, LPUNKNOWN)
  7270. declare_method(EnumEffects, LPDIENUMEFFECTSCALLBACK%, LPVOID, DWORD)
  7271. declare_method(GetEffectInfo, LPDIEFFECTINFO%, REFGUID)
  7272. declare_method(GetForceFeedbackState, LPDWORD)
  7273. declare_method(SendForceFeedbackCommand, DWORD)
  7274. declare_method(EnumCreatedEffectObjects,LPDIENUMCREATEDEFFECTOBJECTSCALLBACK,LPVOID,DWORD)
  7275. declare_method(Escape, LPDIEFFESCAPE)
  7276. declare_method(Poll)
  7277. declare_method(SendDeviceData, DWORD, LPCDIDEVICEOBJECTDATA, LPDWORD, DWORD)
  7278. end_methods()
  7279. end_interface()
  7280. #endif /* DIJ_RINGZERO */
  7281. ;end
  7282. begindoc
  7283. /****************************************************************************
  7284. *
  7285. * IDirectInputDevice7
  7286. *
  7287. ****************************************************************************/
  7288. enddoc
  7289. ;begin_if_(DIRECTINPUT_VERSION)_700
  7290. begindoc
  7291. /****************************************************************************
  7292. *
  7293. * @doc EXTERNAL
  7294. *
  7295. * @flags DirectInput File Effect Flags |
  7296. *
  7297. * Describe attributes of a effects stored in flags.
  7298. *
  7299. * @flag DIFEF_DEFAULT |
  7300. *
  7301. * When passed to <mf IDirectInputDevice7::EnumEffectsInFile>,
  7302. * default processing should occur when enumerating effects.
  7303. * When passed to <mf IDirectInputDevice7::WriteEffectToFile>,
  7304. * default processing should occur when wrinting effects.
  7305. *
  7306. * @flag DIFEF_INCLUDENONSTANDARD |
  7307. *
  7308. * When passed to <mf IDirectInputDevice7::EnumEffectsInFile>,
  7309. * effects not recognized as predefined may be included in the
  7310. * enumeration.
  7311. * When passed to <mf IDirectInputDevice7::WriteEffectToFile>,
  7312. * effects not recognized as predefined may be written to file
  7313. * without an error being raised.
  7314. *
  7315. * @flag DIFEF_MODIFYIFNEEDED |
  7316. *
  7317. * When passed to <mf IDirectInputDevice7::EnumEffectsInFile>,
  7318. * it means that the effect parameters for the enumerated effects
  7319. * are to be adjusted if necessary,
  7320. * so that the effect can be created on the current device.
  7321. *
  7322. ****************************************************************************/
  7323. enddoc
  7324. #define DIFEF_DEFAULT 0x00000000
  7325. #define DIFEF_INCLUDENONSTANDARD 0x00000001
  7326. #define DIFEF_MODIFYIFNEEDED 0x00000010
  7327. #define DIFEF_ENUMVALID 0x00000011;internal
  7328. #define DIFEF_WRITEVALID 0x00000001;internal
  7329. #ifndef DIJ_RINGZERO
  7330. begin_interface(IDirectInputDevice7%, IDirectInputDevice2%)
  7331. begin_methods()
  7332. declare_method(GetCapabilities, LPDIDEVCAPS)
  7333. declare_method(EnumObjects, LPDIENUMDEVICEOBJECTSCALLBACK%, LPVOID, DWORD)
  7334. declare_method(GetProperty, REFGUID, LPDIPROPHEADER)
  7335. declare_method(SetProperty, REFGUID, LPCDIPROPHEADER)
  7336. declare_method(Acquire)
  7337. declare_method(Unacquire)
  7338. declare_method(GetDeviceState, DWORD, LPVOID)
  7339. declare_method(GetDeviceData, DWORD, LPDIDEVICEOBJECTDATA, LPDWORD, DWORD)
  7340. declare_method(SetDataFormat, LPCDIDATAFORMAT)
  7341. declare_method(SetEventNotification, HANDLE)
  7342. declare_method(SetCooperativeLevel, HWND, DWORD)
  7343. declare_method(GetObjectInfo,LPDIDEVICEOBJECTINSTANCE%,DWORD,DWORD)
  7344. declare_method(GetDeviceInfo,LPDIDEVICEINSTANCE%)
  7345. declare_method(RunControlPanel, HWND, DWORD)
  7346. declare_method(Initialize, HINSTANCE, DWORD, REFGUID)
  7347. declare_method(CreateEffect, REFGUID, LPCDIEFFECT, LPDIRECTINPUTEFFECT *, LPUNKNOWN)
  7348. declare_method(EnumEffects, LPDIENUMEFFECTSCALLBACK%, LPVOID, DWORD)
  7349. declare_method(GetEffectInfo, LPDIEFFECTINFO%, REFGUID)
  7350. declare_method(GetForceFeedbackState, LPDWORD)
  7351. declare_method(SendForceFeedbackCommand, DWORD)
  7352. declare_method(EnumCreatedEffectObjects,LPDIENUMCREATEDEFFECTOBJECTSCALLBACK,LPVOID,DWORD)
  7353. declare_method(Escape, LPDIEFFESCAPE)
  7354. declare_method(Poll)
  7355. declare_method(SendDeviceData, DWORD, LPCDIDEVICEOBJECTDATA, LPDWORD, DWORD)
  7356. end_base_class_methods()
  7357. declare_method(EnumEffectsInFile, LPCTSTR%, LPDIENUMEFFECTSINFILECALLBACK, LPVOID, DWORD)
  7358. declare_method(WriteEffectToFile, LPCTSTR%, DWORD, LPDIFILEEFFECT, DWORD)
  7359. end_methods()
  7360. end_interface()
  7361. #endif /* DIJ_RINGZERO */
  7362. ;end
  7363. begindoc
  7364. /****************************************************************************
  7365. *
  7366. * IDirectInputDevice8
  7367. *
  7368. ****************************************************************************/
  7369. enddoc
  7370. ;begin_if_(DIRECTINPUT_VERSION)_800
  7371. #ifndef DIJ_RINGZERO
  7372. begin_interface(IDirectInputDevice8%)
  7373. begin_methods()
  7374. declare_method(GetCapabilities, LPDIDEVCAPS)
  7375. declare_method(EnumObjects, LPDIENUMDEVICEOBJECTSCALLBACK%, LPVOID, DWORD)
  7376. declare_method(GetProperty, REFGUID, LPDIPROPHEADER)
  7377. declare_method(SetProperty, REFGUID, LPCDIPROPHEADER)
  7378. declare_method(Acquire)
  7379. declare_method(Unacquire)
  7380. declare_method(GetDeviceState, DWORD, LPVOID)
  7381. declare_method(GetDeviceData, DWORD, LPDIDEVICEOBJECTDATA, LPDWORD, DWORD)
  7382. declare_method(SetDataFormat, LPCDIDATAFORMAT)
  7383. declare_method(SetEventNotification, HANDLE)
  7384. declare_method(SetCooperativeLevel, HWND, DWORD)
  7385. declare_method(GetObjectInfo,LPDIDEVICEOBJECTINSTANCE%,DWORD,DWORD)
  7386. declare_method(GetDeviceInfo,LPDIDEVICEINSTANCE%)
  7387. declare_method(RunControlPanel, HWND, DWORD)
  7388. declare_method(Initialize, HINSTANCE, DWORD, REFGUID)
  7389. declare_method(CreateEffect, REFGUID, LPCDIEFFECT, LPDIRECTINPUTEFFECT *, LPUNKNOWN)
  7390. declare_method(EnumEffects, LPDIENUMEFFECTSCALLBACK%, LPVOID, DWORD)
  7391. declare_method(GetEffectInfo, LPDIEFFECTINFO%, REFGUID)
  7392. declare_method(GetForceFeedbackState, LPDWORD)
  7393. declare_method(SendForceFeedbackCommand, DWORD)
  7394. declare_method(EnumCreatedEffectObjects,LPDIENUMCREATEDEFFECTOBJECTSCALLBACK,LPVOID,DWORD)
  7395. declare_method(Escape, LPDIEFFESCAPE)
  7396. declare_method(Poll)
  7397. declare_method(SendDeviceData, DWORD,LPCDIDEVICEOBJECTDATA,LPDWORD,DWORD)
  7398. declare_method(EnumEffectsInFile, LPCTSTR%, LPDIENUMEFFECTSINFILECALLBACK, LPVOID, DWORD)
  7399. declare_method(WriteEffectToFile, LPCTSTR%, DWORD, LPDIFILEEFFECT, DWORD)
  7400. declare_method(BuildActionMap,LPDIACTIONFORMAT%,LPCTSTR%,DWORD);
  7401. declare_method(SetActionMap,LPDIACTIONFORMAT%,LPCTSTR%,DWORD);
  7402. declare_method(GetImageInfo,LPDIDEVICEIMAGEINFOHEADER%);
  7403. end_methods()
  7404. end_interface()
  7405. #endif /* DIJ_RINGZERO */
  7406. ;end
  7407. /****************************************************************************
  7408. *
  7409. * Mouse
  7410. *
  7411. ****************************************************************************/
  7412. #ifndef DIJ_RINGZERO
  7413. begindoc
  7414. /****************************************************************************
  7415. *
  7416. * @doc EXTERNAL
  7417. *
  7418. * @struct DIMOUSESTATE |
  7419. *
  7420. * The <t DIMOUSESTATE> structure is used by the
  7421. * <mf IDirectInputDevice::GetDeviceState> method
  7422. * to return the status of a device accessed
  7423. * as if it were a mouse. You must prepare the device
  7424. * for mouse-style access by calling
  7425. * <mf IDirectInputDevice::SetDataFormat>, passing the
  7426. * <p c_dfDIMouse> data format.
  7427. *
  7428. * @field LONG | lX |
  7429. *
  7430. * Contains information about the mouse x-axis.
  7431. * If the device is in relative axis mode, then this
  7432. * field contains the change in mouse x-axis position.
  7433. * If the device is in absolute axis mode, then this
  7434. * field contains the absolute mouse x-axis position.
  7435. *
  7436. * @field LONG | lY |
  7437. *
  7438. * Contains information about the mouse y-axis.
  7439. * If the device is in relative axis mode, then this
  7440. * field contains the change in mouse y-axis position.
  7441. * If the device is in absolute axis mode, then this
  7442. * field contains the absolute mouse y-axis position.
  7443. *
  7444. * @field LONG | lZ |
  7445. *
  7446. * Contains information about the mouse z-axis.
  7447. * If the device is in relative axis mode, then this
  7448. * field contains the change in mouse z-axis position.
  7449. * If the device is in absolute axis mode, then this
  7450. * field contains the absolute mouse z-axis position.
  7451. *
  7452. * If the mouse does not have a z-axis, then the value
  7453. * is zero.
  7454. *
  7455. * @field BYTE | rgbButtons[4] |
  7456. *
  7457. * Array of button states. The high-order bit is set
  7458. * if the corresponding button is down.
  7459. *
  7460. * @comm
  7461. *
  7462. * Remember that the mouse is a relative-axis device,
  7463. * so the absolute axis positions for mouse axes are simply
  7464. * accumulated relative motion. As a result, the
  7465. * value of the absolute axis position is not meaningful
  7466. * except in comparison with other absolute axis positions.
  7467. *
  7468. ****************************************************************************/
  7469. enddoc
  7470. typedef struct _DIMOUSESTATE {
  7471. LONG lX;
  7472. LONG lY;
  7473. LONG lZ;
  7474. BYTE rgbButtons[4];
  7475. } DIMOUSESTATE, *LPDIMOUSESTATE;
  7476. begindoc
  7477. /****************************************************************************
  7478. *
  7479. * @doc EXTERNAL
  7480. *
  7481. * @struct DIMOUSESTATE2 |
  7482. *
  7483. * The <t DIMOUSESTATE2> structure is used by the
  7484. * <mf IDirectInputDevice::GetDeviceState> method
  7485. * to return the status of a device accessed
  7486. * as if it were a mouse. You must prepare the device
  7487. * for mouse-style access by calling
  7488. * <mf IDirectInputDevice::SetDataFormat>, passing the
  7489. * <p c_dfDIMouse2> data format.
  7490. *
  7491. * @field LONG | lX |
  7492. *
  7493. * Contains information about the mouse x-axis.
  7494. * If the device is in relative axis mode, then this
  7495. * field contains the change in mouse x-axis position.
  7496. * If the device is in absolute axis mode, then this
  7497. * field contains the absolute mouse x-axis position.
  7498. *
  7499. * @field LONG | lY |
  7500. *
  7501. * Contains information about the mouse y-axis.
  7502. * If the device is in relative axis mode, then this
  7503. * field contains the change in mouse y-axis position.
  7504. * If the device is in absolute axis mode, then this
  7505. * field contains the absolute mouse y-axis position.
  7506. *
  7507. * @field LONG | lZ |
  7508. *
  7509. * Contains information about the mouse z-axis.
  7510. * If the device is in relative axis mode, then this
  7511. * field contains the change in mouse z-axis position.
  7512. * If the device is in absolute axis mode, then this
  7513. * field contains the absolute mouse z-axis position.
  7514. *
  7515. * If the mouse does not have a z-axis, then the value
  7516. * is zero.
  7517. *
  7518. * @field BYTE | rgbButtons[8] |
  7519. *
  7520. * Array of button states. The high-order bit is set
  7521. * if the corresponding button is down.
  7522. *
  7523. * @comm
  7524. *
  7525. * Remember that the mouse is a relative-axis device,
  7526. * so the absolute axis positions for mouse axes are simply
  7527. * accumulated relative motion. As a result, the
  7528. * value of the absolute axis position is not meaningful
  7529. * except in comparison with other absolute axis positions.
  7530. *
  7531. ****************************************************************************/
  7532. enddoc
  7533. #if DIRECTINPUT_VERSION >= 0x0700
  7534. typedef struct _DIMOUSESTATE2 {
  7535. LONG lX;
  7536. LONG lY;
  7537. LONG lZ;
  7538. BYTE rgbButtons[8];
  7539. } DIMOUSESTATE2, *LPDIMOUSESTATE2;
  7540. #endif
  7541. #if DIRECTINPUT_VERSION >= 0x0700 //;internal
  7542. #define DIMOUSESTATE_INT DIMOUSESTATE2 //;internal
  7543. #define LPDIMOUSESTATE_INT LPDIMOUSESTATE2 //;internal
  7544. #else //;internal
  7545. #define DIMOUSESTATE_INT DIMOUSESTATE //;internal
  7546. #define LPDIMOUSESTATE_INT LPDIMOUSESTATE //;internal
  7547. #endif //;internal
  7548. begindoc
  7549. /****************************************************************************
  7550. *
  7551. * @doc EXTERNAL
  7552. *
  7553. * @define DIMOFS_X | FIELD_OFFSET(DIMOUSESTATE, lX) |
  7554. *
  7555. * The offset of the mouse x-axis position relative
  7556. * to the beginning of the <t DIMOUSESTATE> structure.
  7557. * This value is returned as the <p dwOfs> field
  7558. * in the <t DIDEVICEOBJECTDATA> structure to indicate
  7559. * that the data applies to the mouse x-axis position.
  7560. *
  7561. * @define DIMOFS_Y | FIELD_OFFSET(DIMOUSESTATE, lY) |
  7562. *
  7563. * The offset of the mouse y-axis position relative
  7564. * to the beginning of the <t DIMOUSESTATE> structure.
  7565. * This value is returned as the <p dwOfs> field
  7566. * in the <t DIDEVICEOBJECTDATA> structure to indicate
  7567. * that the data applies to the mouse y-axis position.
  7568. *
  7569. * @define DIMOFS_Z | FIELD_OFFSET(DIMOUSESTATE, lZ) |
  7570. *
  7571. * The offset of the mouse z-axis position relative
  7572. * to the beginning of the <t DIMOUSESTATE> structure.
  7573. * This value is returned as the <p dwOfs> field
  7574. * in the <t DIDEVICEOBJECTDATA> structure to indicate
  7575. * that the data applies to the mouse z-axis position.
  7576. *
  7577. * @define DIMOFS_BUTTON0 | FIELD_OFFSET(DIMOUSESTATE, rgbButtons) + 0 |
  7578. *
  7579. * The offset of the mouse button 0 state relative
  7580. * to the beginning of the <t DIMOUSESTATE> structure.
  7581. * This value is returned as the <p dwOfs> field
  7582. * in the <t DIDEVICEOBJECTDATA> structure to indicate
  7583. * that the data applies to mouse button 0.
  7584. *
  7585. * @define DIMOFS_BUTTON1 | FIELD_OFFSET(DIMOUSESTATE, rgbButtons) + 1 |
  7586. *
  7587. * The offset of the mouse button 1 state relative
  7588. * to the beginning of the <t DIMOUSESTATE> structure.
  7589. * This value is returned as the <p dwOfs> field
  7590. * in the <t DIDEVICEOBJECTDATA> structure to indicate
  7591. * that the data applies to mouse button 1.
  7592. *
  7593. * @define DIMOFS_BUTTON2 | FIELD_OFFSET(DIMOUSESTATE, rgbButtons) + 2 |
  7594. *
  7595. * The offset of the mouse button 2 state relative
  7596. * to the beginning of the <t DIMOUSESTATE> structure.
  7597. * This value is returned as the <p dwOfs> field
  7598. * in the <t DIDEVICEOBJECTDATA> structure to indicate
  7599. * that the data applies to mouse button 2.
  7600. *
  7601. * @define DIMOFS_BUTTON3 | FIELD_OFFSET(DIMOUSESTATE, rgbButtons) + 3 |
  7602. *
  7603. * The offset of the mouse button 3 state relative
  7604. * to the beginning of the <t DIMOUSESTATE> structure.
  7605. * This value is returned as the <p dwOfs> field
  7606. * in the <t DIDEVICEOBJECTDATA> structure to indicate
  7607. * that the data applies to mouse button 3.
  7608. *
  7609. *The following definitions are only for DINPUT_VERSION >= 0x700
  7610. *
  7611. * @define DIMOFS_BUTTON4 | FIELD_OFFSET(DIMOUSESTATE2, rgbButtons) + 4 |
  7612. *
  7613. * The offset of the mouse button 4 state relative
  7614. * to the beginning of the <t DIMOUSESTATE2> structure.
  7615. * This value is returned as the <p dwOfs> field
  7616. * in the <t DIDEVICEOBJECTDATA> structure to indicate
  7617. * that the data applies to mouse button 4.
  7618. *
  7619. * @define DIMOFS_BUTTON5 | FIELD_OFFSET(DIMOUSESTATE2, rgbButtons) + 5 |
  7620. *
  7621. * The offset of the mouse button 5 state relative
  7622. * to the beginning of the <t DIMOUSESTATE2> structure.
  7623. * This value is returned as the <p dwOfs> field
  7624. * in the <t DIDEVICEOBJECTDATA> structure to indicate
  7625. * that the data applies to mouse button 5.
  7626. *
  7627. * @define DIMOFS_BUTTON6 | FIELD_OFFSET(DIMOUSESTATE2, rgbButtons) + 6 |
  7628. *
  7629. * The offset of the mouse button 6 state relative
  7630. * to the beginning of the <t DIMOUSESTATE2> structure.
  7631. * This value is returned as the <p dwOfs> field
  7632. * in the <t DIDEVICEOBJECTDATA> structure to indicate
  7633. * that the data applies to mouse button 6.
  7634. *
  7635. * @define DIMOFS_BUTTON7 | FIELD_OFFSET(DIMOUSESTATE2, rgbButtons) + 7 |
  7636. *
  7637. * The offset of the mouse button 7 state relative
  7638. * to the beginning of the <t DIMOUSESTATE2> structure.
  7639. * This value is returned as the <p dwOfs> field
  7640. * in the <t DIDEVICEOBJECTDATA> structure to indicate
  7641. * that the data applies to mouse button 7.
  7642. *
  7643. ****************************************************************************/
  7644. enddoc
  7645. #define DIMOFS_X FIELD_OFFSET(DIMOUSESTATE, lX)
  7646. #define DIMOFS_Y FIELD_OFFSET(DIMOUSESTATE, lY)
  7647. #define DIMOFS_Z FIELD_OFFSET(DIMOUSESTATE, lZ)
  7648. #define DIMOFS_BUTTON0 (FIELD_OFFSET(DIMOUSESTATE, rgbButtons) + 0)
  7649. #define DIMOFS_BUTTON1 (FIELD_OFFSET(DIMOUSESTATE, rgbButtons) + 1)
  7650. #define DIMOFS_BUTTON2 (FIELD_OFFSET(DIMOUSESTATE, rgbButtons) + 2)
  7651. #define DIMOFS_BUTTON3 (FIELD_OFFSET(DIMOUSESTATE, rgbButtons) + 3)
  7652. #if (DIRECTINPUT_VERSION >= 0x0700)
  7653. #define DIMOFS_BUTTON4 (FIELD_OFFSET(DIMOUSESTATE2, rgbButtons) + 4)
  7654. #define DIMOFS_BUTTON5 (FIELD_OFFSET(DIMOUSESTATE2, rgbButtons) + 5)
  7655. #define DIMOFS_BUTTON6 (FIELD_OFFSET(DIMOUSESTATE2, rgbButtons) + 6)
  7656. #define DIMOFS_BUTTON7 (FIELD_OFFSET(DIMOUSESTATE2, rgbButtons) + 7)
  7657. #endif
  7658. #endif /* DIJ_RINGZERO */
  7659. /****************************************************************************
  7660. *
  7661. * Keyboard
  7662. *
  7663. ****************************************************************************/
  7664. #ifndef DIJ_RINGZERO
  7665. #define DIKBD_CKEYS 256 /* Size of buffers */ //;Internal
  7666. //;Internal
  7667. /****************************************************************************
  7668. *
  7669. * DirectInput keyboard scan codes
  7670. *
  7671. ****************************************************************************/
  7672. sinclude(`dinputk.w')
  7673. /*
  7674. * Alternate names for keys, to facilitate transition from DOS.
  7675. */
  7676. #define DIK_BACKSPACE DIK_BACK /* backspace */
  7677. #define DIK_NUMPADSTAR DIK_MULTIPLY /* * on numeric keypad */
  7678. #define DIK_LALT DIK_LMENU /* left Alt */
  7679. #define DIK_CAPSLOCK DIK_CAPITAL /* CapsLock */
  7680. #define DIK_NUMPADMINUS DIK_SUBTRACT /* - on numeric keypad */
  7681. #define DIK_NUMPADPLUS DIK_ADD /* + on numeric keypad */
  7682. #define DIK_NUMPADPERIOD DIK_DECIMAL /* . on numeric keypad */
  7683. #define DIK_NUMPADSLASH DIK_DIVIDE /* / on numeric keypad */
  7684. #define DIK_RALT DIK_RMENU /* right Alt */
  7685. #define DIK_UPARROW DIK_UP /* UpArrow on arrow keypad */
  7686. #define DIK_PGUP DIK_PRIOR /* PgUp on arrow keypad */
  7687. #define DIK_LEFTARROW DIK_LEFT /* LeftArrow on arrow keypad */
  7688. #define DIK_RIGHTARROW DIK_RIGHT /* RightArrow on arrow keypad */
  7689. #define DIK_DOWNARROW DIK_DOWN /* DownArrow on arrow keypad */
  7690. #define DIK_PGDN DIK_NEXT /* PgDn on arrow keypad */
  7691. #define DIK_PRTSC DIK_SNAPSHOT /* Print Screen */;internal
  7692. /*
  7693. * Alternate names for keys originally not used on US keyboards.
  7694. */
  7695. #define DIK_CIRCUMFLEX DIK_PREVTRACK /* Japanese keyboard */
  7696. #endif /* DIJ_RINGZERO */
  7697. ;begin_public_500
  7698. /****************************************************************************
  7699. *
  7700. * Joystick
  7701. *
  7702. ****************************************************************************/
  7703. #ifndef DIJ_RINGZERO
  7704. begindoc
  7705. /*****************************************************************************
  7706. *
  7707. * @doc EXTERNAL
  7708. *
  7709. * @struct DIJOYSTATE |
  7710. *
  7711. * Instantaneous joystick status information.
  7712. *
  7713. * @field LONG | lX |
  7714. *
  7715. * (OUT) If the joystick supports an x-axis, then
  7716. * <mf IDirectInputDevice::GetDeviceData> will fill
  7717. * the field with the current joystick x-coordinate.
  7718. * If the joystick does not support an x-axis, then
  7719. * the value of this field will be garbage and should
  7720. * not be consulted by the application.
  7721. *
  7722. * @field LONG | lY |
  7723. *
  7724. * (OUT) If the joystick supports a y-axis, then
  7725. * <mf IDirectInputDevice::GetDeviceData> will fill
  7726. * the field with the current joystick y-coordinate.
  7727. * If the joystick does not support a y-axis, then
  7728. * the value of this field will be garbage and should
  7729. * not be consulted by the application.
  7730. *
  7731. * @field LONG | lZ |
  7732. *
  7733. * (OUT) If the joystick supports a z-axis, then
  7734. * <mf IDirectInputDevice::GetDeviceData> will fill
  7735. * the field with the current joystick z-coordinate.
  7736. * If the joystick does not support a z-axis, then
  7737. * the value of this field will be garbage and should
  7738. * not be consulted by the application.
  7739. *
  7740. * @field LONG | lRx |
  7741. *
  7742. * (OUT) If the joystick supports x-axis rotation, then
  7743. * <mf IDirectInputDevice::GetDeviceData> will fill
  7744. * the field with the current joystick x-axis direction.
  7745. * If the joystick does not support x-axis rotation, then
  7746. * the value of this field will be garbage and should
  7747. * not be consulted by the application.
  7748. *
  7749. * @field LONG | lRy |
  7750. *
  7751. * (OUT) If the joystick supports y-axis rotation, then
  7752. * <mf IDirectInputDevice::GetDeviceData> will fill
  7753. * the field with the current joystick y-axis direction.
  7754. * If the joystick does not support y-axis rotation, then
  7755. * the value of this field will be garbage and should
  7756. * not be consulted by the application.
  7757. *
  7758. * @field LONG | lRz |
  7759. *
  7760. * (OUT) If the joystick supports z-axis rotation, then
  7761. * <mf IDirectInputDevice::GetDeviceData> will fill
  7762. * the field with the current joystick z-axis direction,
  7763. * conventionally denoted as "rudder" or "twist".
  7764. * If the joystick does not support z-axis rotation, then
  7765. * the value of this field will be garbage and should
  7766. * not be consulted by the application.
  7767. *
  7768. * @field LONG | rglSlider[2] |
  7769. *
  7770. * (OUT) Two additional axis values whose semantics
  7771. * depend on the joystick. Use the
  7772. * <mf IDirectInputDevice::GetObjectInfo> method to
  7773. * obtain semantic information about these values.
  7774. *
  7775. * @field DWORD | rgdwPOV[4] |
  7776. *
  7777. * (OUT) The current position of up to four direction indicators
  7778. * (point-of-view), or <c JOY_POVCENTERED> if no direction
  7779. * is being indicated.
  7780. *
  7781. * @field BYTE | rgbButtons[32] |
  7782. *
  7783. * (OUT) Array of button states.
  7784. *
  7785. *****************************************************************************/
  7786. enddoc
  7787. typedef struct DIJOYSTATE {
  7788. LONG lX; /* x-axis position */
  7789. LONG lY; /* y-axis position */
  7790. LONG lZ; /* z-axis position */
  7791. LONG lRx; /* x-axis rotation */
  7792. LONG lRy; /* y-axis rotation */
  7793. LONG lRz; /* z-axis rotation */
  7794. LONG rglSlider[2]; /* extra axes positions */
  7795. DWORD rgdwPOV[4]; /* POV directions */
  7796. BYTE rgbButtons[32]; /* 32 buttons */
  7797. } DIJOYSTATE, *LPDIJOYSTATE;
  7798. begindoc
  7799. /*****************************************************************************
  7800. *
  7801. * @doc INTERNAL
  7802. *
  7803. * @struct DIJOYSTATE2 |
  7804. *
  7805. * Extended instantaneous joystick status information
  7806. * suitable for force-feedback joysticks or
  7807. * joysticks with more than 32 buttons.
  7808. *
  7809. * @field LONG | lX |
  7810. *
  7811. * (OUT) If the joystick supports an x-axis, then
  7812. * <mf IDirectInputDevice::GetDeviceData> will fill
  7813. * the field with the current joystick x-coordinate.
  7814. * If the joystick does not support an x-axis, then
  7815. * the value of this field will be garbage and should
  7816. * not be consulted by the application.
  7817. *
  7818. * @field LONG | lY |
  7819. *
  7820. * (OUT) If the joystick supports a y-axis, then
  7821. * <mf IDirectInputDevice::GetDeviceData> will fill
  7822. * the field with the current joystick y-coordinate.
  7823. * If the joystick does not support a y-axis, then
  7824. * the value of this field will be garbage and should
  7825. * not be consulted by the application.
  7826. *
  7827. * @field LONG | lZ |
  7828. *
  7829. * (OUT) If the joystick supports a z-axis, then
  7830. * <mf IDirectInputDevice::GetDeviceData> will fill
  7831. * the field with the current joystick z-coordinate.
  7832. * If the joystick does not support a z-axis, then
  7833. * the value of this field will be garbage and should
  7834. * not be consulted by the application.
  7835. *
  7836. * @field LONG | lRx |
  7837. *
  7838. * (OUT) If the joystick supports x-axis rotation, then
  7839. * <mf IDirectInputDevice::GetDeviceData> will fill
  7840. * the field with the current joystick x-axis direction.
  7841. * If the joystick does not support x-axis rotation, then
  7842. * the value of this field will be garbage and should
  7843. * not be consulted by the application.
  7844. *
  7845. * @field LONG | lRy |
  7846. *
  7847. * (OUT) If the joystick supports y-axis rotation, then
  7848. * <mf IDirectInputDevice::GetDeviceData> will fill
  7849. * the field with the current joystick y-axis direction.
  7850. * If the joystick does not support y-axis rotation, then
  7851. * the value of this field will be garbage and should
  7852. * not be consulted by the application.
  7853. *
  7854. * @field LONG | lRz |
  7855. *
  7856. * (OUT) If the joystick supports z-axis rotation, then
  7857. * <mf IDirectInputDevice::GetDeviceData> will fill
  7858. * the field with the current joystick z-axis direction,
  7859. * conventionally denoted as "rudder" or "twist".
  7860. * If the joystick does not support z-axis rotation, then
  7861. * the value of this field will be garbage and should
  7862. * not be consulted by the application.
  7863. *
  7864. * @field LONG | rglSlider[2] |
  7865. *
  7866. * (OUT) Two additional axis values whose semantics
  7867. * depend on the joystick. Use the
  7868. * <mf IDirectInputDevice::GetObjectInfo> method to
  7869. * obtain semantic information about these values.
  7870. *
  7871. * @field DWORD | rgdwPOV[4] |
  7872. *
  7873. * (OUT) The current position of up to four direction indicators
  7874. * (point-of-view), or <c JOY_POVCENTERED> if no direction
  7875. * is being indicated.
  7876. *
  7877. * @field BYTE | rgbButtons[128] |
  7878. *
  7879. * (OUT) Array of button states.
  7880. *
  7881. * @field LONG | lVX |
  7882. *
  7883. * (OUT) If the joystick supports x-axis velocity, then
  7884. * <mf IDirectInputDevice::GetDeviceData> will fill
  7885. * the field with the current joystick x-velocity.
  7886. * If the joystick does not support x-axis velocity, then
  7887. * the value of this field will be garbage and should
  7888. * not be consulted by the application.
  7889. *
  7890. * @field LONG | lVY |
  7891. *
  7892. * (OUT) If the joystick supports y-axis velocity, then
  7893. * <mf IDirectInputDevice::GetDeviceData> will fill
  7894. * the field with the current joystick y-velocity.
  7895. * If the joystick does not support y-axis velocity, then
  7896. * the value of this field will be garbage and should
  7897. * not be consulted by the application.
  7898. *
  7899. * @field LONG | lVZ |
  7900. *
  7901. * (OUT) If the joystick supports z-axis velocity, then
  7902. * <mf IDirectInputDevice::GetDeviceData> will fill
  7903. * the field with the current joystick z-velocity.
  7904. * If the joystick does not support z-axis velocity, then
  7905. * the value of this field will be garbage and should
  7906. * not be consulted by the application.
  7907. *
  7908. * @field LONG | lVRx |
  7909. *
  7910. * (OUT) If the joystick supports x-axis angular velocity, then
  7911. * <mf IDirectInputDevice::GetDeviceData> will fill
  7912. * the field with the current joystick x-axis angular velocity.
  7913. * If the joystick does not support x-axis angular velocity, then
  7914. * the value of this field will be garbage and should
  7915. * not be consulted by the application.
  7916. *
  7917. * @field LONG | lVRy |
  7918. *
  7919. * (OUT) If the joystick supports y-axis angular velocity, then
  7920. * <mf IDirectInputDevice::GetDeviceData> will fill
  7921. * the field with the current joystick y-axis angular velocity.
  7922. * If the joystick does not support y-axis angular velocity, then
  7923. * the value of this field will be garbage and should
  7924. * not be consulted by the application.
  7925. *
  7926. * @field LONG | lVRz |
  7927. *
  7928. * (OUT) If the joystick supports z-axis angular velocity, then
  7929. * <mf IDirectInputDevice::GetDeviceData> will fill
  7930. * the field with the current joystick z-axis angular velocity.
  7931. * If the joystick does not support z-axis angular velocity, then
  7932. * the value of this field will be garbage and should
  7933. * not be consulted by the application.
  7934. *
  7935. * @field LONG | rglVSlider[2] |
  7936. *
  7937. * (OUT) Velocities of two additional axis values whose semantics
  7938. * depend on the joystick. Use the
  7939. * <mf IDirectInputDevice::GetObjectInfo> method to
  7940. * obtain semantic information about these values.
  7941. *
  7942. * @field LONG | lAX |
  7943. *
  7944. * (OUT) If the joystick supports x-axis acceleration, then
  7945. * <mf IDirectInputDevice::GetDeviceData> will fill
  7946. * the field with the current joystick x-acceleration.
  7947. * If the joystick does not support x-axis acceleration, then
  7948. * the value of this field will be garbage and should
  7949. * not be consulted by the application.
  7950. *
  7951. * @field LONG | lAY |
  7952. *
  7953. * (OUT) If the joystick supports y-axis acceleration, then
  7954. * <mf IDirectInputDevice::GetDeviceData> will fill
  7955. * the field with the current joystick y-acceleration.
  7956. * If the joystick does not support y-axis acceleration, then
  7957. * the value of this field will be garbage and should
  7958. * not be consulted by the application.
  7959. *
  7960. * @field LONG | lAZ |
  7961. *
  7962. * (OUT) If the joystick supports z-axis acceleration, then
  7963. * <mf IDirectInputDevice::GetDeviceData> will fill
  7964. * the field with the current joystick z-acceleration.
  7965. * If the joystick does not support z-axis acceleration, then
  7966. * the value of this field will be garbage and should
  7967. * not be consulted by the application.
  7968. *
  7969. * @field LONG | lARx |
  7970. *
  7971. * (OUT) If the joystick supports x-axis angular acceleration, then
  7972. * <mf IDirectInputDevice::GetDeviceData> will fill
  7973. * the field with the current joystick x-axis angular acceleration.
  7974. * If the joystick does not support x-axis angular acceleration, then
  7975. * the value of this field will be garbage and should
  7976. * not be consulted by the application.
  7977. *
  7978. * @field LONG | lARy |
  7979. *
  7980. * (OUT) If the joystick supports y-axis angular acceleration, then
  7981. * <mf IDirectInputDevice::GetDeviceData> will fill
  7982. * the field with the current joystick y-axis angular acceleration.
  7983. * If the joystick does not support y-axis angular acceleration, then
  7984. * the value of this field will be garbage and should
  7985. * not be consulted by the application.
  7986. *
  7987. * @field LONG | lARz |
  7988. *
  7989. * (OUT) If the joystick supports z-axis angular acceleration, then
  7990. * <mf IDirectInputDevice::GetDeviceData> will fill
  7991. * the field with the current joystick z-axis angular acceleration.
  7992. * If the joystick does not support z-axis angular acceleration, then
  7993. * the value of this field will be garbage and should
  7994. * not be consulted by the application.
  7995. *
  7996. * @field LONG | rglASlider[2] |
  7997. *
  7998. * (OUT) Accelerations of two additional axis values whose semantics
  7999. * depend on the joystick. Use the
  8000. * <mf IDirectInputDevice::GetObjectInfo> method to
  8001. * obtain semantic information about these values.
  8002. *
  8003. * @field LONG | lFX |
  8004. *
  8005. * (OUT) If the joystick supports reporting x-axis force, then
  8006. * <mf IDirectInputDevice::GetDeviceData> will fill
  8007. * the field with the current joystick x-force.
  8008. * If the joystick does not support x-axis force, then
  8009. * the value of this field will be garbage and should
  8010. * not be consulted by the application.
  8011. *
  8012. * @field LONG | lFY |
  8013. *
  8014. * (OUT) If the joystick supports reporting y-axis force, then
  8015. * <mf IDirectInputDevice::GetDeviceData> will fill
  8016. * the field with the current joystick y-force.
  8017. * If the joystick does not support y-axis force, then
  8018. * the value of this field will be garbage and should
  8019. * not be consulted by the application.
  8020. *
  8021. * @field LONG | lFZ |
  8022. *
  8023. * (OUT) If the joystick supports reporting z-axis force, then
  8024. * <mf IDirectInputDevice::GetDeviceData> will fill
  8025. * the field with the current joystick z-force.
  8026. * If the joystick does not support z-axis force, then
  8027. * the value of this field will be garbage and should
  8028. * not be consulted by the application.
  8029. *
  8030. * @field LONG | lFRx |
  8031. *
  8032. * (OUT) If the joystick supports reporting x-axis torque, then
  8033. * <mf IDirectInputDevice::GetDeviceData> will fill
  8034. * the field with the current joystick x-axis angular force.
  8035. * If the joystick does not support x-axis angular force, then
  8036. * the value of this field will be garbage and should
  8037. * not be consulted by the application.
  8038. *
  8039. * @field LONG | lFRy |
  8040. *
  8041. * (OUT) If the joystick supports reporting y-axis torque, then
  8042. * <mf IDirectInputDevice::GetDeviceData> will fill
  8043. * the field with the current joystick y-axis torque.
  8044. * If the joystick does not support y-axis torque, then
  8045. * the value of this field will be garbage and should
  8046. * not be consulted by the application.
  8047. *
  8048. * @field LONG | lFRz |
  8049. *
  8050. * (OUT) If the joystick supports z-reporting axis torque, then
  8051. * <mf IDirectInputDevice::GetDeviceData> will fill
  8052. * the field with the current joystick z-axis torque.
  8053. * If the joystick does not support z-axis torque, then
  8054. * the value of this field will be garbage and should
  8055. * not be consulted by the application.
  8056. *
  8057. * @field LONG | rglFSlider[2] |
  8058. *
  8059. * (OUT) Forces of two additional axis values whose semantics
  8060. * depend on the joystick. Use the
  8061. * <mf IDirectInputDevice::GetObjectInfo> method to
  8062. * obtain semantic information about these values.
  8063. *
  8064. *****************************************************************************/
  8065. enddoc
  8066. typedef struct DIJOYSTATE2 {
  8067. LONG lX; /* x-axis position */
  8068. LONG lY; /* y-axis position */
  8069. LONG lZ; /* z-axis position */
  8070. LONG lRx; /* x-axis rotation */
  8071. LONG lRy; /* y-axis rotation */
  8072. LONG lRz; /* z-axis rotation */
  8073. LONG rglSlider[2]; /* extra axes positions */
  8074. DWORD rgdwPOV[4]; /* POV directions */
  8075. BYTE rgbButtons[128]; /* 128 buttons */
  8076. LONG lVX; /* x-axis velocity */
  8077. LONG lVY; /* y-axis velocity */
  8078. LONG lVZ; /* z-axis velocity */
  8079. LONG lVRx; /* x-axis angular velocity */
  8080. LONG lVRy; /* y-axis angular velocity */
  8081. LONG lVRz; /* z-axis angular velocity */
  8082. LONG rglVSlider[2]; /* extra axes velocities */
  8083. LONG lAX; /* x-axis acceleration */
  8084. LONG lAY; /* y-axis acceleration */
  8085. LONG lAZ; /* z-axis acceleration */
  8086. LONG lARx; /* x-axis angular acceleration */
  8087. LONG lARy; /* y-axis angular acceleration */
  8088. LONG lARz; /* z-axis angular acceleration */
  8089. LONG rglASlider[2]; /* extra axes accelerations */
  8090. LONG lFX; /* x-axis force */
  8091. LONG lFY; /* y-axis force */
  8092. LONG lFZ; /* z-axis force */
  8093. LONG lFRx; /* x-axis torque */
  8094. LONG lFRy; /* y-axis torque */
  8095. LONG lFRz; /* z-axis torque */
  8096. LONG rglFSlider[2]; /* extra axes forces */
  8097. } DIJOYSTATE2, *LPDIJOYSTATE2;
  8098. begindoc
  8099. /****************************************************************************
  8100. *
  8101. * @doc EXTERNAL
  8102. *
  8103. * @define DIJOFS_X | FIELD_OFFSET(DIJOYSTATE, lX) |
  8104. *
  8105. * The offset of the joystick x-axis position relative
  8106. * to the beginning of the <t DIJOYSTATE> structure.
  8107. * This value is returned as the <p dwOfs> field
  8108. * in the <t DIDEVICEOBJECTDATA> structure to indicate
  8109. * that the data applies to the joystick x-axis position.
  8110. *
  8111. * @define DIJOFS_Y | FIELD_OFFSET(DIJOYSTATE, lY) |
  8112. *
  8113. * The offset of the joystick y-axis position relative
  8114. * to the beginning of the <t DIJOYSTATE> structure.
  8115. * This value is returned as the <p dwOfs> field
  8116. * in the <t DIDEVICEOBJECTDATA> structure to indicate
  8117. * that the data applies to the joystick y-axis position.
  8118. *
  8119. * @define DIJOFS_Z | FIELD_OFFSET(DIJOYSTATE, lZ) |
  8120. *
  8121. * The offset of the joystick z-axis position relative
  8122. * to the beginning of the <t DIJOYSTATE> structure.
  8123. * This value is returned as the <p dwOfs> field
  8124. * in the <t DIDEVICEOBJECTDATA> structure to indicate
  8125. * that the data applies to the joystick z-axis position.
  8126. *
  8127. * @define DIJOFS_RX | FIELD_OFFSET(DIJOYSTATE, lRx) |
  8128. *
  8129. * The offset of the joystick x-axis rotation relative
  8130. * to the beginning of the <t DIJOYSTATE> structure.
  8131. * This value is returned as the <p dwOfs> field
  8132. * in the <t DIDEVICEOBJECTDATA> structure to indicate
  8133. * that the data applies to the joystick x-axis rotation.
  8134. *
  8135. * @define DIJOFS_RY | FIELD_OFFSET(DIJOYSTATE, lRy) |
  8136. *
  8137. * The offset of the joystick y-axis rotation relative
  8138. * to the beginning of the <t DIJOYSTATE> structure.
  8139. * This value is returned as the <p dwOfs> field
  8140. * in the <t DIDEVICEOBJECTDATA> structure to indicate
  8141. * that the data applies to the joystick y-axis rotation.
  8142. *
  8143. * @define DIJOFS_RZ | FIELD_OFFSET(DIJOYSTATE, lRx) |
  8144. *
  8145. * The offset of the joystick z-axis rotation relative
  8146. * to the beginning of the <t DIJOYSTATE> structure.
  8147. * This value is returned as the <p dwOfs> field
  8148. * in the <t DIDEVICEOBJECTDATA> structure to indicate
  8149. * that the data applies to the joystick z-axis rotation.
  8150. *
  8151. * @define DIJOFS_SLIDER(n) |
  8152. * FIELD_OFFSET(DIJOYSTATE, rglSlider) + n * sizeof(LONG) |
  8153. *
  8154. * The offset of the joystick slider <c n> position relative
  8155. * to the beginning of the <t DIJOYSTATE> structure.
  8156. * This value is returned as the <p dwOfs> field
  8157. * in the <t DIDEVICEOBJECTDATA> structure to indicate
  8158. * that the data applies to the joystick slider <c n> position.
  8159. *
  8160. * @define DIJOFS_POV(n) |
  8161. * FIELD_OFFSET(DIJOYSTATE, rgdwPOV) + n * sizeof(DWORD) |
  8162. *
  8163. * The offset of the joystick POV <c n> position relative
  8164. * to the beginning of the <t DIJOYSTATE> structure.
  8165. * This value is returned as the <p dwOfs> field
  8166. * in the <t DIDEVICEOBJECTDATA> structure to indicate
  8167. * that the data applies to the joystick POV <c n> position.
  8168. *
  8169. * @define DIJOFS_BUTTON(n) | FIELD_OFFSET(DIJOYSTATE, rgbButtons) + n |
  8170. *
  8171. * The offset of the joystick button <c n> state relative
  8172. * to the beginning of the <t DIJOYSTATE> structure.
  8173. * This value is returned as the <p dwOfs> field
  8174. * in the <t DIDEVICEOBJECTDATA> structure to indicate
  8175. * that the data applies to joystick button <c n>.
  8176. *
  8177. * For convenience, the first 32 buttons can also be accessed
  8178. * with the names with the macros <c DIJOFS_BUTTON0>
  8179. * through <c DIJOFS_BUTTON31>.
  8180. *
  8181. ****************************************************************************/
  8182. enddoc
  8183. #define DIJOFS_X FIELD_OFFSET(DIJOYSTATE, lX)
  8184. #define DIJOFS_Y FIELD_OFFSET(DIJOYSTATE, lY)
  8185. #define DIJOFS_Z FIELD_OFFSET(DIJOYSTATE, lZ)
  8186. #define DIJOFS_RX FIELD_OFFSET(DIJOYSTATE, lRx)
  8187. #define DIJOFS_RY FIELD_OFFSET(DIJOYSTATE, lRy)
  8188. #define DIJOFS_RZ FIELD_OFFSET(DIJOYSTATE, lRz)
  8189. #define DIJOFS_SLIDER(n) (FIELD_OFFSET(DIJOYSTATE, rglSlider) + \
  8190. (n) * sizeof(LONG))
  8191. #define DIJOFS_POV(n) (FIELD_OFFSET(DIJOYSTATE, rgdwPOV) + \
  8192. (n) * sizeof(DWORD))
  8193. #define DIJOFS_BUTTON(n) (FIELD_OFFSET(DIJOYSTATE, rgbButtons) + (n))
  8194. #define DIJOFS_BUTTON0 DIJOFS_BUTTON(0)
  8195. #define DIJOFS_BUTTON1 DIJOFS_BUTTON(1)
  8196. #define DIJOFS_BUTTON2 DIJOFS_BUTTON(2)
  8197. #define DIJOFS_BUTTON3 DIJOFS_BUTTON(3)
  8198. #define DIJOFS_BUTTON4 DIJOFS_BUTTON(4)
  8199. #define DIJOFS_BUTTON5 DIJOFS_BUTTON(5)
  8200. #define DIJOFS_BUTTON6 DIJOFS_BUTTON(6)
  8201. #define DIJOFS_BUTTON7 DIJOFS_BUTTON(7)
  8202. #define DIJOFS_BUTTON8 DIJOFS_BUTTON(8)
  8203. #define DIJOFS_BUTTON9 DIJOFS_BUTTON(9)
  8204. #define DIJOFS_BUTTON10 DIJOFS_BUTTON(10)
  8205. #define DIJOFS_BUTTON11 DIJOFS_BUTTON(11)
  8206. #define DIJOFS_BUTTON12 DIJOFS_BUTTON(12)
  8207. #define DIJOFS_BUTTON13 DIJOFS_BUTTON(13)
  8208. #define DIJOFS_BUTTON14 DIJOFS_BUTTON(14)
  8209. #define DIJOFS_BUTTON15 DIJOFS_BUTTON(15)
  8210. #define DIJOFS_BUTTON16 DIJOFS_BUTTON(16)
  8211. #define DIJOFS_BUTTON17 DIJOFS_BUTTON(17)
  8212. #define DIJOFS_BUTTON18 DIJOFS_BUTTON(18)
  8213. #define DIJOFS_BUTTON19 DIJOFS_BUTTON(19)
  8214. #define DIJOFS_BUTTON20 DIJOFS_BUTTON(20)
  8215. #define DIJOFS_BUTTON21 DIJOFS_BUTTON(21)
  8216. #define DIJOFS_BUTTON22 DIJOFS_BUTTON(22)
  8217. #define DIJOFS_BUTTON23 DIJOFS_BUTTON(23)
  8218. #define DIJOFS_BUTTON24 DIJOFS_BUTTON(24)
  8219. #define DIJOFS_BUTTON25 DIJOFS_BUTTON(25)
  8220. #define DIJOFS_BUTTON26 DIJOFS_BUTTON(26)
  8221. #define DIJOFS_BUTTON27 DIJOFS_BUTTON(27)
  8222. #define DIJOFS_BUTTON28 DIJOFS_BUTTON(28)
  8223. #define DIJOFS_BUTTON29 DIJOFS_BUTTON(29)
  8224. #define DIJOFS_BUTTON30 DIJOFS_BUTTON(30)
  8225. #define DIJOFS_BUTTON31 DIJOFS_BUTTON(31)
  8226. ;end_public_500
  8227. #endif /* DIJ_RINGZERO */
  8228. /****************************************************************************
  8229. *
  8230. * IDirectInput
  8231. *
  8232. ****************************************************************************/
  8233. #ifndef DIJ_RINGZERO
  8234. #define DIENUM_STOP 0
  8235. #define DIENUM_CONTINUE 1
  8236. typedef BOOL (FAR PASCAL * LPDIENUMDEVICESCALLBACK%)(LPCDIDEVICEINSTANCE%, LPVOID);
  8237. typedef BOOL (FAR PASCAL * LPDICONFIGUREDEVICESCALLBACK)(IUnknown FAR *, LPVOID);
  8238. #define DIEDFL_ALLDEVICES 0x00000000
  8239. #define DIEDFL_ATTACHEDONLY 0x00000001
  8240. ;begin_if_(DIRECTINPUT_VERSION)_500
  8241. #define DIEDFL_FORCEFEEDBACK 0x00000100
  8242. ;end
  8243. ;begin_if_(DIRECTINPUT_VERSION)_50A
  8244. #define DIEDFL_INCLUDEALIASES 0x00010000
  8245. #define DIEDFL_INCLUDEPHANTOMS 0x00020000
  8246. ;end
  8247. ;begin_if_(DIRECTINPUT_VERSION)_800
  8248. #define DIEDFL_INCLUDEHIDDEN 0x00040000
  8249. ;end
  8250. #define DIEDFL_INCLUDEMASK 0x00FF0000;internal_50A
  8251. #define DIEDFL_VALID 0x00030101;internal
  8252. ;begin_internal_800
  8253. #if DIRECTINPUT_VERSION > 0x700
  8254. #define DIEDFL_VALID_DX5 0x00030101
  8255. #undef DIEDFL_VALID
  8256. #define DIEDFL_VALID 0x00070101
  8257. #endif /* DIRECTINPUT_VERSION > 0x700 */
  8258. ;end_internal_800
  8259. ;begin_if_(DIRECTINPUT_VERSION)_800
  8260. typedef BOOL (FAR PASCAL * LPDIENUMDEVICESBYSEMANTICSCB%)(LPCDIDEVICEINSTANCE%, LPDIRECTINPUTDEVICE8%, DWORD, DWORD, LPVOID);
  8261. ;end
  8262. begindoc
  8263. /****************************************************************************
  8264. *
  8265. * @doc EXTERNAL
  8266. *
  8267. * @flags Flags provides information about why the devie is being enumerated.
  8268. * This can be a combination of any action-mapping flag, and one usage flag.
  8269. * At least one action-mapping flag will always be present.
  8270. *
  8271. * Action Mapping Flags:
  8272. *
  8273. * @flag DIEDBS_MAPPEDPRI1 |
  8274. *
  8275. * This device is being enumerated because priority 1 actions can be mapped
  8276. * to the device.
  8277. *
  8278. * @flag DIEDBS_MAPPEDPRI2 |
  8279. *
  8280. * This device is being enumerated because priority 2 actions can be mapped
  8281. * to the device.
  8282. *
  8283. * Usage Flags:
  8284. *
  8285. * @flag DIEDBS_RECENTDEVICE |
  8286. *
  8287. * The device is being enumerated because the commands described by the
  8288. * Action Mapping Flags were recently used.
  8289. *
  8290. * @flag DIEDBS_NEWDEVICE |
  8291. *
  8292. * The device is being enumerated because the device was installed recently
  8293. * (sometime after the last set of commands were applied to another device).
  8294. * Devices described by this flag have not been used with this game before.
  8295. *
  8296. *****************************************************************************/
  8297. enddoc
  8298. ;begin_if_(DIRECTINPUT_VERSION)_800
  8299. #define DIEDBS_MAPPEDPRI1 0x00000001
  8300. #define DIEDBS_MAPPEDPRI2 0x00000002
  8301. #define DIEDBS_RECENTDEVICE 0x00000010
  8302. #define DIEDBS_NEWDEVICE 0x00000020
  8303. ;end
  8304. begindoc
  8305. /****************************************************************************
  8306. *
  8307. * @doc EXTERNAL
  8308. *
  8309. * @flags Flag passed to <mf IDirectInput8::EnumDevicesBySemantics> to
  8310. * specify which devices will be enumerated.
  8311. *
  8312. * @flag DIEDBSFL_ATTACHEDONLY |
  8313. *
  8314. * All appropriate installed devices are enumerated, even those
  8315. * in use by another user. This is the default behavior.
  8316. * With this flag, HID keyboards/mice, and non-gaming devices,
  8317. * such as HID speakers/monitors, won't be enumerated.
  8318. *
  8319. * @flag DIEDBSFL_AVAILABLEDEVICES |
  8320. *
  8321. * Only unowned installed devices are enumerated.
  8322. *
  8323. * @flag DIEDBSFL_THISUSER |
  8324. *
  8325. * All installed devices owned by the user identified by ptszUserName
  8326. * are enumerated.
  8327. *
  8328. * @flag DIEDBSFL_FORCEFEEDBACK |
  8329. *
  8330. * Only devices that support force feedback.
  8331. *
  8332. * @flag DIEDBSFL_MULTIMICEKEYBOARDS |
  8333. *
  8334. * HID mice, and HID keyboards are enumerated.
  8335. *
  8336. * @flag DIEDBSFL_NONGAMINGDEVICES |
  8337. *
  8338. * Non-gaming devices, such as HID speakers, HID monitors, are enumerated.
  8339. *
  8340. * Note:
  8341. * All these flags can be combined.
  8342. * For example: if you want to enumerate all available devices and the devices
  8343. * owned by a user, you can use flag: DIEDBSFL_THISUSER | DIEDBSFL_AVAILABLEDEVICES.
  8344. *
  8345. *****************************************************************************/
  8346. enddoc
  8347. ;begin_if_(DIRECTINPUT_VERSION)_800
  8348. #define DIEDBSFL_ATTACHEDONLY 0x00000000
  8349. #define DIEDBSFL_THISUSER 0x00000010
  8350. #define DIEDBSFL_FORCEFEEDBACK DIEDFL_FORCEFEEDBACK
  8351. #define DIEDBSFL_AVAILABLEDEVICES 0x00001000
  8352. #define DIEDBSFL_MULTIMICEKEYBOARDS 0x00002000
  8353. #define DIEDBSFL_NONGAMINGDEVICES 0x00004000
  8354. #define DIEDBSFL_VALID 0x00007110
  8355. ;end
  8356. begin_interface(IDirectInput%)
  8357. begin_methods()
  8358. declare_method(CreateDevice,REFGUID, LPDIRECTINPUTDEVICE% *, LPUNKNOWN)
  8359. declare_method(EnumDevices,DWORD, LPDIENUMDEVICESCALLBACK%, LPVOID, DWORD)
  8360. declare_method(GetDeviceStatus, REFGUID)
  8361. declare_method(RunControlPanel,HWND, DWORD)
  8362. declare_method(Initialize, HINSTANCE, DWORD)
  8363. end_methods()
  8364. end_interface()
  8365. ;begin_public_500
  8366. begin_interface(IDirectInput2%, IDirectInput%)
  8367. begin_methods()
  8368. declare_method(CreateDevice,REFGUID, LPDIRECTINPUTDEVICE% *, LPUNKNOWN)
  8369. declare_method(EnumDevices,DWORD, LPDIENUMDEVICESCALLBACK%, LPVOID, DWORD)
  8370. declare_method(GetDeviceStatus, REFGUID)
  8371. declare_method(RunControlPanel,HWND, DWORD)
  8372. declare_method(Initialize, HINSTANCE, DWORD)
  8373. end_base_class_methods()
  8374. declare_method(FindDevice,REFGUID, LPCTSTR%, LPGUID)
  8375. end_methods()
  8376. end_interface()
  8377. ;end_public_500
  8378. ;begin_public_700
  8379. begin_interface(IDirectInput7%, IDirectInput2%)
  8380. begin_methods()
  8381. declare_method(CreateDevice,REFGUID, LPDIRECTINPUTDEVICE% *, LPUNKNOWN)
  8382. declare_method(EnumDevices,DWORD, LPDIENUMDEVICESCALLBACK%, LPVOID, DWORD)
  8383. declare_method(GetDeviceStatus, REFGUID)
  8384. declare_method(RunControlPanel,HWND, DWORD)
  8385. declare_method(Initialize, HINSTANCE, DWORD)
  8386. declare_method(FindDevice,REFGUID, LPCTSTR%, LPGUID)
  8387. end_base_class_methods()
  8388. declare_method(CreateDeviceEx, REFGUID, REFIID, LPVOID *, LPUNKNOWN)
  8389. end_methods()
  8390. end_interface()
  8391. ;end_public_700
  8392. ;begin_public_800
  8393. ;begin_if_(DIRECTINPUT_VERSION)_800
  8394. begin_interface(IDirectInput8%)
  8395. begin_methods()
  8396. declare_method(CreateDevice,REFGUID, LPDIRECTINPUTDEVICE8% *, LPUNKNOWN)
  8397. declare_method(EnumDevices,DWORD, LPDIENUMDEVICESCALLBACK%, LPVOID, DWORD)
  8398. declare_method(GetDeviceStatus, REFGUID)
  8399. declare_method(RunControlPanel,HWND, DWORD)
  8400. declare_method(Initialize, HINSTANCE, DWORD)
  8401. declare_method(FindDevice,REFGUID, LPCTSTR%, LPGUID)
  8402. declare_method(EnumDevicesBySemantics,LPCTSTR%,LPDIACTIONFORMAT%,LPDIENUMDEVICESBYSEMANTICSCB%,LPVOID,DWORD)
  8403. declare_method(ConfigureDevices, LPDICONFIGUREDEVICESCALLBACK, LPDICONFIGUREDEVICESPARAMS%, DWORD, LPVOID)
  8404. end_methods()
  8405. end_interface()
  8406. ;end
  8407. ;end_public_800
  8408. #if DIRECTINPUT_VERSION > 0x0700
  8409. extern HRESULT WINAPI DirectInput8Create(HINSTANCE hinst, DWORD dwVersion, REFIID riidltf, LPVOID *ppvOut, LPUNKNOWN punkOuter);
  8410. #else
  8411. extern HRESULT WINAPI DirectInputCreate%(HINSTANCE hinst, DWORD dwVersion, LPDIRECTINPUT% *ppDI, LPUNKNOWN punkOuter);
  8412. ;begin_public_700
  8413. extern HRESULT WINAPI DirectInputCreateEx(HINSTANCE hinst, DWORD dwVersion, REFIID riidltf, LPVOID *ppvOut, LPUNKNOWN punkOuter);
  8414. ;end_public_700
  8415. #endif /* DIRECTINPUT_VERSION > 0x700 */
  8416. #endif /* DIJ_RINGZERO */
  8417. /****************************************************************************
  8418. *
  8419. * Return Codes
  8420. *
  8421. ****************************************************************************/
  8422. /*
  8423. * The operation completed successfully.
  8424. */
  8425. #define DI_OK S_OK
  8426. /*
  8427. * The device exists but is not currently attached.
  8428. */
  8429. #define DI_NOTATTACHED S_FALSE
  8430. /*
  8431. * The device buffer overflowed. Some input was lost.
  8432. */
  8433. #define DI_BUFFEROVERFLOW S_FALSE
  8434. /*
  8435. * The change in device properties had no effect.
  8436. */
  8437. #define DI_PROPNOEFFECT S_FALSE
  8438. /*
  8439. * The operation had no effect.
  8440. */
  8441. #define DI_NOEFFECT S_FALSE
  8442. /*
  8443. * The device is a polled device. As a result, device buffering
  8444. * will not collect any data and event notifications will not be
  8445. * signalled until GetDeviceState is called.
  8446. */
  8447. #define DI_POLLEDDEVICE ((HRESULT)0x00000002L)
  8448. /*
  8449. * The parameters of the effect were successfully updated by
  8450. * IDirectInputEffect::SetParameters, but the effect was not
  8451. * downloaded because the device is not exclusively acquired
  8452. * or because the DIEP_NODOWNLOAD flag was passed.
  8453. */
  8454. #define DI_DOWNLOADSKIPPED ((HRESULT)0x00000003L)
  8455. /*
  8456. * The parameters of the effect were successfully updated by
  8457. * IDirectInputEffect::SetParameters, but in order to change
  8458. * the parameters, the effect needed to be restarted.
  8459. */
  8460. #define DI_EFFECTRESTARTED ((HRESULT)0x00000004L)
  8461. /*
  8462. * The parameters of the effect were successfully updated by
  8463. * IDirectInputEffect::SetParameters, but some of them were
  8464. * beyond the capabilities of the device and were truncated.
  8465. */
  8466. #define DI_TRUNCATED ((HRESULT)0x00000008L)
  8467. ;begin_public_800
  8468. /*
  8469. * The settings have been successfully applied but could not be
  8470. * persisted.
  8471. */
  8472. #define DI_SETTINGSNOTSAVED ((HRESULT)0x0000000BL)
  8473. ;end_public_800
  8474. /*
  8475. * Equal to DI_EFFECTRESTARTED | DI_TRUNCATED.
  8476. */
  8477. #define DI_TRUNCATEDANDRESTARTED ((HRESULT)0x0000000CL)
  8478. ;begin_public_800
  8479. /*
  8480. * A SUCCESS code indicating that settings cannot be modified.
  8481. */
  8482. #define DI_WRITEPROTECT ((HRESULT)0x00000013L)
  8483. ;end_public_800
  8484. /*
  8485. * The application requires a newer version of DirectInput.
  8486. */
  8487. #define DIERR_OLDDIRECTINPUTVERSION \
  8488. MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_OLD_WIN_VERSION)
  8489. /*
  8490. * The application was written for an unsupported prerelease version
  8491. * of DirectInput.
  8492. */
  8493. #define DIERR_BETADIRECTINPUTVERSION \
  8494. MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_RMODE_APP)
  8495. /*
  8496. * The object could not be created due to an incompatible driver version
  8497. * or mismatched or incomplete driver components.
  8498. */
  8499. #define DIERR_BADDRIVERVER \
  8500. MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_BAD_DRIVER_LEVEL)
  8501. /*
  8502. * The device or device instance is not registered with DirectInput.;public_dx3
  8503. * The device or device instance or effect is not registered with DirectInput.;public_500
  8504. */
  8505. #define DIERR_DEVICENOTREG REGDB_E_CLASSNOTREG
  8506. ;begin_public_500
  8507. /*
  8508. * The requested object does not exist.
  8509. */
  8510. #define DIERR_NOTFOUND \
  8511. MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_FILE_NOT_FOUND)
  8512. ;end_public_500
  8513. /*
  8514. * The requested object does not exist.
  8515. */
  8516. #define DIERR_OBJECTNOTFOUND \
  8517. MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_FILE_NOT_FOUND)
  8518. /*
  8519. * An invalid parameter was passed to the returning function,
  8520. * or the object was not in a state that admitted the function
  8521. * to be called.
  8522. */
  8523. #define DIERR_INVALIDPARAM E_INVALIDARG
  8524. /*
  8525. * The specified interface is not supported by the object
  8526. */
  8527. #define DIERR_NOINTERFACE E_NOINTERFACE
  8528. /*
  8529. * An undetermined error occured inside the DInput subsystem
  8530. */
  8531. #define DIERR_GENERIC E_FAIL
  8532. /*
  8533. * The DInput subsystem couldn't allocate sufficient memory to complete the
  8534. * caller's request.
  8535. */
  8536. #define DIERR_OUTOFMEMORY E_OUTOFMEMORY
  8537. /*
  8538. * The function called is not supported at this time
  8539. */
  8540. #define DIERR_UNSUPPORTED E_NOTIMPL
  8541. /*
  8542. * This object has not been initialized
  8543. */
  8544. #define DIERR_NOTINITIALIZED \
  8545. MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_NOT_READY)
  8546. /*
  8547. * This object is already initialized
  8548. */
  8549. #define DIERR_ALREADYINITIALIZED \
  8550. MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_ALREADY_INITIALIZED)
  8551. /*
  8552. * This object does not support aggregation
  8553. */
  8554. #define DIERR_NOAGGREGATION CLASS_E_NOAGGREGATION
  8555. /*
  8556. * Another app has a higher priority level, preventing this call from
  8557. * succeeding.
  8558. */
  8559. #define DIERR_OTHERAPPHASPRIO E_ACCESSDENIED
  8560. /*
  8561. ;begin_public_dx3
  8562. * Access to the input device has been lost. It must be re-acquired.
  8563. ;end_public_dx3
  8564. ;begin_public_500
  8565. * Access to the device has been lost. It must be re-acquired.
  8566. ;end_public_500
  8567. */
  8568. #define DIERR_INPUTLOST \
  8569. MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_READ_FAULT)
  8570. /*
  8571. * The operation cannot be performed while the device is acquired.
  8572. */
  8573. #define DIERR_ACQUIRED \
  8574. MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_BUSY)
  8575. /*
  8576. * The operation cannot be performed unless the device is acquired.
  8577. */
  8578. #define DIERR_NOTACQUIRED \
  8579. MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_INVALID_ACCESS)
  8580. /*
  8581. * The specified property cannot be changed.
  8582. */
  8583. #define DIERR_READONLY E_ACCESSDENIED
  8584. /*
  8585. * The device already has an event notification associated with it.
  8586. */
  8587. #define DIERR_HANDLEEXISTS E_ACCESSDENIED
  8588. /*
  8589. * Data is not yet available.
  8590. */
  8591. #ifndef E_PENDING
  8592. #define E_PENDING 0x8000000AL
  8593. #endif
  8594. ;begin_public_500
  8595. /*
  8596. * Unable to IDirectInputJoyConfig_Acquire because the user
  8597. * does not have sufficient privileges to change the joystick
  8598. * configuration.
  8599. */
  8600. #define DIERR_INSUFFICIENTPRIVS 0x80040200L
  8601. /*
  8602. * The device is full.
  8603. */
  8604. #define DIERR_DEVICEFULL 0x80040201L
  8605. /*
  8606. * Not all the requested information fit into the buffer.
  8607. */
  8608. #define DIERR_MOREDATA 0x80040202L
  8609. /*
  8610. * The effect is not downloaded.
  8611. */
  8612. #define DIERR_NOTDOWNLOADED 0x80040203L
  8613. /*
  8614. * The device cannot be reinitialized because there are still effects
  8615. * attached to it.
  8616. */
  8617. #define DIERR_HASEFFECTS 0x80040204L
  8618. /*
  8619. * The operation cannot be performed unless the device is acquired
  8620. * in DISCL_EXCLUSIVE mode.
  8621. */
  8622. #define DIERR_NOTEXCLUSIVEACQUIRED 0x80040205L
  8623. /*
  8624. * The effect could not be downloaded because essential information
  8625. * is missing. For example, no axes have been associated with the
  8626. * effect, or no type-specific information has been created.
  8627. */
  8628. #define DIERR_INCOMPLETEEFFECT 0x80040206L
  8629. /*
  8630. * Attempted to read buffered device data from a device that is
  8631. * not buffered.
  8632. */
  8633. #define DIERR_NOTBUFFERED 0x80040207L
  8634. /*
  8635. * An attempt was made to modify parameters of an effect while it is
  8636. * playing. Not all hardware devices support altering the parameters
  8637. * of an effect while it is playing.
  8638. */
  8639. #define DIERR_EFFECTPLAYING 0x80040208L
  8640. /*
  8641. * The operation could not be completed because the device is not
  8642. * plugged in.
  8643. */
  8644. #define DIERR_UNPLUGGED 0x80040209L
  8645. /*
  8646. * SendDeviceData failed because more information was requested
  8647. * to be sent than can be sent to the device. Some devices have
  8648. * restrictions on how much data can be sent to them. (For example,
  8649. * there might be a limit on the number of buttons that can be
  8650. * pressed at once.)
  8651. */
  8652. #define DIERR_REPORTFULL 0x8004020AL
  8653. ;end_public_500
  8654. ;begin_public_800
  8655. /*
  8656. * A mapper file function failed because reading or writing the user or IHV
  8657. * settings file failed.
  8658. */
  8659. #define DIERR_MAPFILEFAIL 0x8004020BL
  8660. ;end_public_800
  8661. sinclude(semdef.w)
  8662. sinclude(semantic.w)
  8663. #ifdef __cplusplus
  8664. };
  8665. #endif
  8666. #endif /* __DINPUT_INCLUDED__ */
  8667. /****************************************************************************
  8668. *
  8669. * Definitions for non-IDirectInput (VJoyD) features defined more recently
  8670. * than the current sdk files
  8671. *
  8672. ****************************************************************************/
  8673. #ifdef _INC_MMSYSTEM
  8674. #ifndef MMNOJOY
  8675. #ifndef __VJOYDX_INCLUDED__
  8676. #define __VJOYDX_INCLUDED__
  8677. #ifdef __cplusplus
  8678. extern "C" {
  8679. #endif
  8680. /*
  8681. * Flag to indicate that the dwReserved2 field of the JOYINFOEX structure
  8682. * contains mini-driver specific data to be passed by VJoyD to the mini-
  8683. * driver instead of doing a poll.
  8684. */
  8685. #define JOY_PASSDRIVERDATA 0x10000000l
  8686. /*
  8687. * Informs the joystick driver that the configuration has been changed
  8688. * and should be reloaded from the registery.
  8689. * dwFlags is reserved and should be set to zero
  8690. */
  8691. WINMMAPI MMRESULT WINAPI joyConfigChanged( DWORD dwFlags );
  8692. #ifndef DIJ_RINGZERO
  8693. /*
  8694. * Invoke the joystick control panel directly, using the passed window handle
  8695. * as the parent of the dialog. This API is only supported for compatibility
  8696. * purposes; new applications should use the RunControlPanel method of a
  8697. * device interface for a game controller.
  8698. * The API is called by using the function pointer returned by
  8699. * GetProcAddress( hCPL, TEXT("ShowJoyCPL") ) where hCPL is a HMODULE returned
  8700. * by LoadLibrary( TEXT("joy.cpl") ). The typedef is provided to allow
  8701. * declaration and casting of an appropriately typed variable.
  8702. */
  8703. void WINAPI ShowJoyCPL( HWND hWnd );
  8704. typedef void (WINAPI* LPFNSHOWJOYCPL)( HWND hWnd );
  8705. #endif
  8706. /*
  8707. * Hardware Setting indicating that the device is a headtracker
  8708. */
  8709. #define JOY_HWS_ISHEADTRACKER 0x02000000l
  8710. /*
  8711. * Hardware Setting indicating that the VxD is used to replace
  8712. * the standard analog polling
  8713. */
  8714. #define JOY_HWS_ISGAMEPORTDRIVER 0x04000000l
  8715. /*
  8716. * Hardware Setting indicating that the driver needs a standard
  8717. * gameport in order to communicate with the device.
  8718. */
  8719. #define JOY_HWS_ISANALOGPORTDRIVER 0x08000000l
  8720. /*
  8721. * Hardware Setting indicating that VJoyD should not load this
  8722. * driver, it will be loaded externally and will register with
  8723. * VJoyD of it's own accord.
  8724. */
  8725. #define JOY_HWS_AUTOLOAD 0x10000000l
  8726. /*
  8727. * Hardware Setting indicating that the driver acquires any
  8728. * resources needed without needing a devnode through VJoyD.
  8729. */
  8730. #define JOY_HWS_NODEVNODE 0x20000000l
  8731. ;begin_public_dx5
  8732. /*
  8733. * Hardware Setting indicating that the VxD can be used as
  8734. * a port 201h emulator.
  8735. */
  8736. #define JOY_HWS_ISGAMEPORTEMULATOR 0x40000000l
  8737. ;end_public_dx5
  8738. ;begin_public_5B2
  8739. /*
  8740. * Hardware Setting indicating that the device is a gameport bus
  8741. */
  8742. #define JOY_HWS_ISGAMEPORTBUS 0x80000000l
  8743. #define JOY_HWS_GAMEPORTBUSBUSY 0x00000001l
  8744. ;end_public_5B2
  8745. /*
  8746. * Usage Setting indicating that the settings are volatile and
  8747. * should be removed if still present on a reboot.
  8748. */
  8749. #define JOY_US_VOLATILE 0x00000008L
  8750. #ifdef __cplusplus
  8751. };
  8752. #endif
  8753. #endif /* __VJOYDX_INCLUDED__ */
  8754. #endif /* not MMNOJOY */
  8755. #endif /* _INC_MMSYSTEM */
  8756. /****************************************************************************
  8757. *
  8758. * Definitions for non-IDirectInput (VJoyD) features defined more recently
  8759. * than the current ddk files
  8760. *
  8761. ****************************************************************************/
  8762. #ifndef DIJ_RINGZERO
  8763. #ifdef _INC_MMDDK
  8764. #ifndef MMNOJOYDEV
  8765. #ifndef __VJOYDXD_INCLUDED__
  8766. #define __VJOYDXD_INCLUDED__
  8767. /*
  8768. * Poll type in which the do_other field of the JOYOEMPOLLDATA
  8769. * structure contains mini-driver specific data passed from an app.
  8770. */
  8771. #define JOY_OEMPOLL_PASSDRIVERDATA 7
  8772. #endif /* __VJOYDXD_INCLUDED__ */
  8773. #endif /* not MMNOJOYDEV */
  8774. #endif /* _INC_MMDDK */
  8775. #endif /* DIJ_RINGZERO */