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.

77 lines
3.2 KiB

  1. /***************************************************************************
  2. *
  3. * Copyright (C) 1997 Microsoft Corporation. All Rights Reserved.
  4. *
  5. * File: dijoyhid.h
  6. * Content: DirectInput internal include file JoyHid mapping
  7. *
  8. ***************************************************************************/
  9. #ifndef DIJOYHID_H
  10. #define DIJOYHID_H
  11. #define MIN_PERIOD 10 /* minimum polling period */
  12. #define MAX_PERIOD 1000 /* maximum polling period */
  13. typedef struct tag_USAGES {
  14. DWORD dwUsage;
  15. DWORD dwFlags;
  16. DWORD dwCaps;
  17. DWORD dwAxisPos;
  18. } USAGES;
  19. #define USAGE_SENTINAL { 0x0, 0x0, 0x0 }
  20. enum eControls { // Index list for supported joystick axes
  21. ecX=0x0, ecY, ecZ, ecRz, ecRy, ecRx, ecEnd
  22. };
  23. #ifndef HID_USAGE_SIMULATION
  24. #define HID_USAGE_SIMULATION_STEERING ((USAGE) 0xC8)
  25. #endif
  26. #ifndef HID_USAGE_SIMULATION_ACCELERATOR
  27. #define HID_USAGE_SIMULATION_ACCELERATOR ((USAGE) 0xC4)
  28. #endif
  29. #ifndef HID_USAGE_SIMULATION_BRAKE
  30. #define HID_USAGE_SIMULATION_BRAKE ((USAGE) 0xC5)
  31. #endif
  32. /*
  33. * keep the following dwAxisPos as ascending.
  34. */
  35. USAGES AxesUsages[] = {
  36. { DIMAKEUSAGEDWORD(HID_USAGE_PAGE_GENERIC, HID_USAGE_GENERIC_X), 0x0, 0x0 , 0 }, // X
  37. { DIMAKEUSAGEDWORD(HID_USAGE_PAGE_SIMULATION, HID_USAGE_SIMULATION_STEERING), 0x0, 0x0 , 0 },
  38. { DIMAKEUSAGEDWORD(HID_USAGE_PAGE_GENERIC, HID_USAGE_GENERIC_Y), 0x0, 0x0 , 1 }, // Y
  39. { DIMAKEUSAGEDWORD(HID_USAGE_PAGE_SIMULATION, HID_USAGE_SIMULATION_ACCELERATOR), 0x0, 0x0 , 1 },
  40. { DIMAKEUSAGEDWORD(HID_USAGE_PAGE_GENERIC, HID_USAGE_GENERIC_Z), JOY_HWS_HASZ, JOYCAPS_HASZ, 2 }, // Z
  41. { DIMAKEUSAGEDWORD(HID_USAGE_PAGE_GENERIC, HID_USAGE_GENERIC_SLIDER), JOY_HWS_HASZ, JOYCAPS_HASZ, 2 },
  42. { DIMAKEUSAGEDWORD(HID_USAGE_PAGE_SIMULATION, HID_USAGE_SIMULATION_THROTTLE), JOY_HWS_HASZ, JOYCAPS_HASZ, 2 },
  43. { DIMAKEUSAGEDWORD(HID_USAGE_PAGE_SIMULATION, HID_USAGE_GENERIC_DIAL), JOY_HWS_HASZ, JOYCAPS_HASZ, 2 },
  44. { DIMAKEUSAGEDWORD(HID_USAGE_PAGE_GENERIC, HID_USAGE_GENERIC_WHEEL), JOY_HWS_HASZ, JOYCAPS_HASZ, 2 },
  45. { DIMAKEUSAGEDWORD(HID_USAGE_PAGE_SIMULATION, HID_USAGE_SIMULATION_RUDDER), JOY_HWS_HASR, JOYCAPS_HASR, 3 },
  46. { DIMAKEUSAGEDWORD(HID_USAGE_PAGE_GENERIC, HID_USAGE_GENERIC_RZ), JOY_HWS_HASR, JOYCAPS_HASR, 3 }, // R
  47. { DIMAKEUSAGEDWORD(HID_USAGE_PAGE_SIMULATION, HID_USAGE_SIMULATION_BRAKE), JOY_HWS_HASR, JOYCAPS_HASR, 3 },
  48. { DIMAKEUSAGEDWORD(HID_USAGE_PAGE_GENERIC, HID_USAGE_GENERIC_RY), JOY_HWS_HASU, JOYCAPS_HASU, 4 }, // U
  49. { DIMAKEUSAGEDWORD(HID_USAGE_PAGE_SIMULATION, HID_USAGE_SIMULATION_THROTTLE), JOY_HWS_HASU, JOYCAPS_HASU, 4 },
  50. { DIMAKEUSAGEDWORD(HID_USAGE_PAGE_GENERIC, HID_USAGE_GENERIC_SLIDER), JOY_HWS_HASU, JOYCAPS_HASU, 4 },
  51. { DIMAKEUSAGEDWORD(HID_USAGE_PAGE_GENERIC, HID_USAGE_GENERIC_RX), JOY_HWS_HASV, JOYCAPS_HASV, 5 }, // V
  52. USAGE_SENTINAL
  53. };
  54. USAGES CheckHatswitch[] = {
  55. { DIMAKEUSAGEDWORD(HID_USAGE_PAGE_GENERIC, HID_USAGE_GENERIC_HATSWITCH) , JOY_HWS_HASPOV, JOYCAPS_HASPOV }, // ecHatswitch
  56. USAGE_SENTINAL
  57. };
  58. #endif // DIJOYHID_H