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.

74 lines
2.9 KiB

  1. /*****************************************************************************
  2. *
  3. * DILib5.c
  4. *
  5. * Copyright (c) 1999 Microsoft Corporation. All Rights Reserved.
  6. *
  7. * Abstract:
  8. *
  9. * Objects exported statically into our library.
  10. *
  11. * Contents:
  12. *
  13. * c_dfDIMouse2
  14. *
  15. *****************************************************************************/
  16. #include "dinputpr.h"
  17. #if DIRECTINPUT_VERSION >= 0x0700
  18. /*****************************************************************************
  19. *
  20. * @doc INTERNAL
  21. *
  22. * @global DIOBJECTDATAFORMAT | c_rgdoiDIMouse2[] |
  23. *
  24. * Device object data formats for mouse-style access.
  25. *
  26. * @global DIDEVICEFORMAT | c_dfDIMouse2 |
  27. *
  28. * Device format for mouse-style access.
  29. *
  30. * A pointer to this structure may be passed to
  31. * <mf IDirectInputDevice::SetDataFormat> to indicate that
  32. * the device will be accessed in the form of a mouse.
  33. *
  34. * When a device has been set to the mouse data format,
  35. * the <mf IDirectInputDevice::GetDeviceState> function
  36. * returns a <t DIMOUSESTATE2> structure, and the
  37. * <mf IDirectInputDevice::GetDeviceData> function
  38. * returns a <t DIDEVICEOBJECTDATA> whose <p dwOfs>
  39. * field is a <c DIMOFS_*> value which describes the
  40. * object whose data is being reported.
  41. *
  42. *****************************************************************************/
  43. #pragma BEGIN_CONST_DATA
  44. static DIOBJECTDATAFORMAT c_rgodfDIMouse2[] = {
  45. { &GUID_XAxis, FIELD_OFFSET(DIMOUSESTATE2, lX), DIDFT_AXIS | DIDFT_ANYINSTANCE, },
  46. { &GUID_YAxis, FIELD_OFFSET(DIMOUSESTATE2, lY), DIDFT_AXIS | DIDFT_ANYINSTANCE, },
  47. { &GUID_ZAxis, FIELD_OFFSET(DIMOUSESTATE2, lZ), DIDFT_AXIS | DIDFT_ANYINSTANCE | DIDFT_OPTIONAL, },
  48. { 0, FIELD_OFFSET(DIMOUSESTATE2, rgbButtons[0]), DIDFT_BUTTON | DIDFT_ANYINSTANCE, },
  49. { 0, FIELD_OFFSET(DIMOUSESTATE2, rgbButtons[1]), DIDFT_BUTTON | DIDFT_ANYINSTANCE, },
  50. { 0, FIELD_OFFSET(DIMOUSESTATE2, rgbButtons[2]), DIDFT_BUTTON | DIDFT_ANYINSTANCE | DIDFT_OPTIONAL, },
  51. { 0, FIELD_OFFSET(DIMOUSESTATE2, rgbButtons[3]), DIDFT_BUTTON | DIDFT_ANYINSTANCE | DIDFT_OPTIONAL, },
  52. { 0, FIELD_OFFSET(DIMOUSESTATE2, rgbButtons[4]), DIDFT_BUTTON | DIDFT_ANYINSTANCE | DIDFT_OPTIONAL, },
  53. { 0, FIELD_OFFSET(DIMOUSESTATE2, rgbButtons[5]), DIDFT_BUTTON | DIDFT_ANYINSTANCE | DIDFT_OPTIONAL, },
  54. { 0, FIELD_OFFSET(DIMOUSESTATE2, rgbButtons[6]), DIDFT_BUTTON | DIDFT_ANYINSTANCE | DIDFT_OPTIONAL, },
  55. { 0, FIELD_OFFSET(DIMOUSESTATE2, rgbButtons[7]), DIDFT_BUTTON | DIDFT_ANYINSTANCE | DIDFT_OPTIONAL, },
  56. };
  57. const DIDATAFORMAT c_dfDIMouse2 = {
  58. sizeof(DIDATAFORMAT),
  59. sizeof(DIOBJECTDATAFORMAT),
  60. DIDF_RELAXIS,
  61. sizeof(DIMOUSESTATE2),
  62. cA(c_rgodfDIMouse2),
  63. c_rgodfDIMouse2,
  64. };
  65. #endif
  66. #pragma END_CONST_DATA