Leaked source code of windows server 2003
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.

66 lines
2.4 KiB

  1. /*****************************************************************************
  2. *
  3. * DILib1.c
  4. *
  5. * Copyright (c) 1996 Microsoft Corporation. All Rights Reserved.
  6. *
  7. * Abstract:
  8. *
  9. * Objects exported statically into our library.
  10. *
  11. * Contents:
  12. *
  13. * c_dfDIMouse
  14. *
  15. *****************************************************************************/
  16. #include "dinputpr.h"
  17. /*****************************************************************************
  18. *
  19. * @doc INTERNAL
  20. *
  21. * @global DIOBJECTDATAFORMAT | c_rgdoiDIMouse[] |
  22. *
  23. * Device object data formats for mouse-style access.
  24. *
  25. * @global DIDEVICEFORMAT | c_dfDIMouse |
  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 DIMOUSESTATE> 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_rgodfDIMouse[] = {
  44. { &GUID_XAxis, FIELD_OFFSET(DIMOUSESTATE, lX), DIDFT_AXIS | DIDFT_ANYINSTANCE, },
  45. { &GUID_YAxis, FIELD_OFFSET(DIMOUSESTATE, lY), DIDFT_AXIS | DIDFT_ANYINSTANCE, },
  46. { &GUID_ZAxis, FIELD_OFFSET(DIMOUSESTATE, lZ), DIDFT_AXIS | DIDFT_ANYINSTANCE | DIDFT_OPTIONAL, },
  47. { 0, FIELD_OFFSET(DIMOUSESTATE, rgbButtons[0]), DIDFT_BUTTON | DIDFT_ANYINSTANCE, },
  48. { 0, FIELD_OFFSET(DIMOUSESTATE, rgbButtons[1]), DIDFT_BUTTON | DIDFT_ANYINSTANCE, },
  49. { 0, FIELD_OFFSET(DIMOUSESTATE, rgbButtons[2]), DIDFT_BUTTON | DIDFT_ANYINSTANCE | DIDFT_OPTIONAL, },
  50. { 0, FIELD_OFFSET(DIMOUSESTATE, rgbButtons[3]), DIDFT_BUTTON | DIDFT_ANYINSTANCE | DIDFT_OPTIONAL, },
  51. };
  52. const DIDATAFORMAT c_dfDIMouse = {
  53. sizeof(DIDATAFORMAT),
  54. sizeof(DIOBJECTDATAFORMAT),
  55. DIDF_RELAXIS,
  56. sizeof(DIMOUSESTATE),
  57. cA(c_rgodfDIMouse),
  58. c_rgodfDIMouse,
  59. };
  60. #pragma END_CONST_DATA