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.

141 lines
6.2 KiB

  1. /*****************************************************************************
  2. *
  3. * DIJoyReg.h
  4. *
  5. * Copyright (c) 1996 Microsoft Corporation. All Rights Reserved.
  6. *
  7. * Abstract:
  8. *
  9. * Registry-related snippets from the Windows 95 mmddk.h file.
  10. * We must steal it because the Windows NT mmddk.h file does not
  11. * contain the registry settings. (Sigh.)
  12. *
  13. *****************************************************************************/
  14. #include <regstr.h>
  15. /* pre-defined joystick types */
  16. #define JOY_HW_NONE 0
  17. #define JOY_HW_CUSTOM 1
  18. #define JOY_HW_2A_2B_GENERIC 2
  19. #define JOY_HW_2A_4B_GENERIC 3
  20. #define JOY_HW_2B_GAMEPAD 4
  21. #define JOY_HW_2B_FLIGHTYOKE 5
  22. #define JOY_HW_2B_FLIGHTYOKETHROTTLE 6
  23. #define JOY_HW_3A_2B_GENERIC 7
  24. #define JOY_HW_3A_4B_GENERIC 8
  25. #define JOY_HW_4B_GAMEPAD 9
  26. #define JOY_HW_4B_FLIGHTYOKE 10
  27. #define JOY_HW_4B_FLIGHTYOKETHROTTLE 11
  28. #define JOY_HW_TWO_2A_2B_WITH_Y 12
  29. #define JOY_HW_LASTENTRY 13
  30. /* calibration flags */
  31. #define JOY_ISCAL_XY 0x00000001l /* XY are calibrated */
  32. #define JOY_ISCAL_Z 0x00000002l /* Z is calibrated */
  33. #define JOY_ISCAL_R 0x00000004l /* R is calibrated */
  34. #define JOY_ISCAL_U 0x00000008l /* U is calibrated */
  35. #define JOY_ISCAL_V 0x00000010l /* V is calibrated */
  36. #define JOY_ISCAL_POV 0x00000020l /* POV is calibrated */
  37. /* point of view constants */
  38. #define JOY_POV_NUMDIRS 4
  39. #define JOY_POVVAL_FORWARD 0
  40. #define JOY_POVVAL_BACKWARD 1
  41. #define JOY_POVVAL_LEFT 2
  42. #define JOY_POVVAL_RIGHT 3
  43. /* Specific settings for joystick hardware */
  44. #define JOY_HWS_HASZ 0x00000001l /* has Z info? */
  45. #define JOY_HWS_HASPOV 0x00000002l /* point of view hat present */
  46. #define JOY_HWS_POVISBUTTONCOMBOS 0x00000004l /* pov done through combo of buttons */
  47. #define JOY_HWS_POVISPOLL 0x00000008l /* pov done through polling */
  48. #define JOY_HWS_ISYOKE 0x00000010l /* joystick is a flight yoke */
  49. #define JOY_HWS_ISGAMEPAD 0x00000020l /* joystick is a game pad */
  50. #define JOY_HWS_ISCARCTRL 0x00000040l /* joystick is a car controller */
  51. /* X defaults to J1 X axis */
  52. #define JOY_HWS_XISJ1Y 0x00000080l /* X is on J1 Y axis */
  53. #define JOY_HWS_XISJ2X 0x00000100l /* X is on J2 X axis */
  54. #define JOY_HWS_XISJ2Y 0x00000200l /* X is on J2 Y axis */
  55. /* Y defaults to J1 Y axis */
  56. #define JOY_HWS_YISJ1X 0x00000400l /* Y is on J1 X axis */
  57. #define JOY_HWS_YISJ2X 0x00000800l /* Y is on J2 X axis */
  58. #define JOY_HWS_YISJ2Y 0x00001000l /* Y is on J2 Y axis */
  59. /* Z defaults to J2 Y axis */
  60. #define JOY_HWS_ZISJ1X 0x00002000l /* Z is on J1 X axis */
  61. #define JOY_HWS_ZISJ1Y 0x00004000l /* Z is on J1 Y axis */
  62. #define JOY_HWS_ZISJ2X 0x00008000l /* Z is on J2 X axis */
  63. /* POV defaults to J2 Y axis, if it is not button based */
  64. #define JOY_HWS_POVISJ1X 0x00010000l /* pov done through J1 X axis */
  65. #define JOY_HWS_POVISJ1Y 0x00020000l /* pov done through J1 Y axis */
  66. #define JOY_HWS_POVISJ2X 0x00040000l /* pov done through J2 X axis */
  67. /* R defaults to J2 X axis */
  68. #define JOY_HWS_HASR 0x00080000l /* has R (4th axis) info */
  69. #define JOY_HWS_RISJ1X 0x00100000l /* R done through J1 X axis */
  70. #define JOY_HWS_RISJ1Y 0x00200000l /* R done through J1 Y axis */
  71. #define JOY_HWS_RISJ2Y 0x00400000l /* R done through J2 X axis */
  72. /* U & V for future hardware */
  73. #define JOY_HWS_HASU 0x00800000l /* has U (5th axis) info */
  74. #define JOY_HWS_HASV 0x01000000l /* has V (6th axis) info */
  75. /* Usage settings */
  76. #define JOY_US_HASRUDDER 0x00000001l /* joystick configured with rudder */
  77. #define JOY_US_PRESENT 0x00000002l /* is joystick actually present? */
  78. #define JOY_US_ISOEM 0x00000004l /* joystick is an OEM defined type */
  79. /* struct for storing x,y, z, and rudder values */
  80. typedef struct joypos_tag {
  81. DWORD dwX;
  82. DWORD dwY;
  83. DWORD dwZ;
  84. DWORD dwR;
  85. DWORD dwU;
  86. DWORD dwV;
  87. } JOYPOS, FAR *LPJOYPOS;
  88. /* struct for storing ranges */
  89. typedef struct joyrange_tag {
  90. JOYPOS jpMin;
  91. JOYPOS jpMax;
  92. JOYPOS jpCenter;
  93. } JOYRANGE,FAR *LPJOYRANGE;
  94. typedef struct joyreguservalues_tag {
  95. DWORD dwTimeOut; /* value at which to timeout joystick polling */
  96. JOYRANGE jrvRanges; /* range of values app wants returned for axes */
  97. JOYPOS jpDeadZone; /* area around center to be considered
  98. as "dead". specified as a percentage
  99. (0-100). Only X & Y handled by system driver */
  100. } JOYREGUSERVALUES, FAR *LPJOYREGUSERVALUES;
  101. typedef struct joyreghwsettings_tag {
  102. DWORD dwFlags;
  103. DWORD dwNumButtons; /* number of buttons */
  104. } JOYREGHWSETTINGS, FAR *LPJOYHWSETTINGS;
  105. /* range of values returned by the hardware (filled in by calibration) */
  106. typedef struct joyreghwvalues_tag {
  107. JOYRANGE jrvHardware; /* values returned by hardware */
  108. DWORD dwPOVValues[JOY_POV_NUMDIRS];/* POV values returned by hardware */
  109. DWORD dwCalFlags; /* what has been calibrated */
  110. } JOYREGHWVALUES, FAR *LPJOYREGHWVALUES;
  111. /* hardware configuration */
  112. typedef struct joyreghwconfig_tag {
  113. JOYREGHWSETTINGS hws; /* hardware settings */
  114. DWORD dwUsageSettings;/* usage settings */
  115. JOYREGHWVALUES hwv; /* values returned by hardware */
  116. DWORD dwType; /* type of joystick */
  117. DWORD dwReserved; /* reserved for OEM drivers */
  118. } JOYREGHWCONFIG, FAR *LPJOYREGHWCONFIG;
  119. /* joystick calibration info structure */
  120. typedef struct joycalibrate_tag {
  121. UINT wXbase;
  122. UINT wXdelta;
  123. UINT wYbase;
  124. UINT wYdelta;
  125. UINT wZbase;
  126. UINT wZdelta;
  127. } JOYCALIBRATE;
  128. typedef JOYCALIBRATE FAR *LPJOYCALIBRATE;