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.

71 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. /*****************************************************************************
  18. *
  19. * @doc INTERNAL
  20. *
  21. * @global DIOBJECTDATAFORMAT | c_rgdoiDIMouse2[] |
  22. *
  23. * Device object data formats for mouse-style access.
  24. *
  25. * @global DIDEVICEFORMAT | c_dfDIMouse2 |
  26. *
  27. * Device format for mouse-style access.
  28. *
  29. * A pointer to this structure may be passed to
  30. * <mf IDirectInputDevice::SetDataFormat> to indicate that
  31. * the device will be accessed in the form of a mouse.
  32. *
  33. * When a device has been set to the mouse data format,
  34. * the <mf IDirectInputDevice::GetDeviceState> function
  35. * returns a <t DIMOUSESTATE2> structure, and the
  36. * <mf IDirectInputDevice::GetDeviceData> function
  37. * returns a <t DIDEVICEOBJECTDATA> whose <p dwOfs>
  38. * field is a <c DIMOFS_*> value which describes the
  39. * object whose data is being reported.
  40. *
  41. *****************************************************************************/
  42. #pragma BEGIN_CONST_DATA
  43. static DIOBJECTDATAFORMAT c_rgodfDIMouse2[] = {
  44. { &GUID_XAxis, FIELD_OFFSET(DIMOUSESTATE2, lX), DIDFT_AXIS | DIDFT_ANYINSTANCE, },
  45. { &GUID_YAxis, FIELD_OFFSET(DIMOUSESTATE2, lY), DIDFT_AXIS | DIDFT_ANYINSTANCE, },
  46. { &GUID_ZAxis, FIELD_OFFSET(DIMOUSESTATE2, lZ), DIDFT_AXIS | DIDFT_ANYINSTANCE | DIDFT_OPTIONAL, },
  47. { 0, FIELD_OFFSET(DIMOUSESTATE2, rgbButtons[0]), DIDFT_BUTTON | DIDFT_ANYINSTANCE, },
  48. { 0, FIELD_OFFSET(DIMOUSESTATE2, rgbButtons[1]), DIDFT_BUTTON | DIDFT_ANYINSTANCE, },
  49. { 0, FIELD_OFFSET(DIMOUSESTATE2, rgbButtons[2]), DIDFT_BUTTON | DIDFT_ANYINSTANCE | DIDFT_OPTIONAL, },
  50. { 0, FIELD_OFFSET(DIMOUSESTATE2, rgbButtons[3]), DIDFT_BUTTON | DIDFT_ANYINSTANCE | DIDFT_OPTIONAL, },
  51. { 0, FIELD_OFFSET(DIMOUSESTATE2, rgbButtons[4]), DIDFT_BUTTON | DIDFT_ANYINSTANCE | DIDFT_OPTIONAL, },
  52. { 0, FIELD_OFFSET(DIMOUSESTATE2, rgbButtons[5]), DIDFT_BUTTON | DIDFT_ANYINSTANCE | DIDFT_OPTIONAL, },
  53. { 0, FIELD_OFFSET(DIMOUSESTATE2, rgbButtons[6]), DIDFT_BUTTON | DIDFT_ANYINSTANCE | DIDFT_OPTIONAL, },
  54. { 0, FIELD_OFFSET(DIMOUSESTATE2, rgbButtons[7]), DIDFT_BUTTON | DIDFT_ANYINSTANCE | DIDFT_OPTIONAL, },
  55. };
  56. const DIDATAFORMAT c_dfDIMouse2 = {
  57. sizeof(DIDATAFORMAT),
  58. sizeof(DIOBJECTDATAFORMAT),
  59. DIDF_RELAXIS,
  60. sizeof(DIMOUSESTATE2),
  61. cA(c_rgodfDIMouse2),
  62. c_rgodfDIMouse2,
  63. };
  64. #pragma END_CONST_DATA