Counter Strike : Global Offensive Source Code
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.

182 lines
4.3 KiB

  1. //===== Copyright � 1996-2005, Valve Corporation, All rights reserved. ======//
  2. //
  3. // Purpose:
  4. //
  5. //===========================================================================//
  6. #ifndef INPUTENUMS_H
  7. #define INPUTENUMS_H
  8. #ifdef _WIN32
  9. #pragma once
  10. #endif
  11. #include "tier0/basetypes.h"
  12. // Standard maximum +/- value of a joystick axis
  13. #define MAX_BUTTONSAMPLE 32768
  14. #if !defined( _X360 )
  15. #define INVALID_USER_ID -1
  16. #else
  17. #define INVALID_USER_ID XBX_INVALID_USER_ID
  18. #endif
  19. //-----------------------------------------------------------------------------
  20. // Forward declarations:
  21. //-----------------------------------------------------------------------------
  22. enum
  23. {
  24. #ifdef _PS3
  25. MAX_JOYSTICKS = 7,
  26. #else
  27. MAX_JOYSTICKS = 4,
  28. #endif
  29. MOUSE_BUTTON_COUNT = 5,
  30. MAX_NOVINT_DEVICES = 2,
  31. };
  32. enum JoystickAxis_t
  33. {
  34. JOY_AXIS_X = 0,
  35. JOY_AXIS_Y,
  36. JOY_AXIS_Z,
  37. JOY_AXIS_R,
  38. JOY_AXIS_U,
  39. JOY_AXIS_V,
  40. MAX_JOYSTICK_AXES,
  41. };
  42. enum JoystickDeadzoneMode_t
  43. {
  44. JOYSTICK_DEADZONE_CROSS = 0,
  45. JOYSTICK_DEADZONE_SQUARE = 1,
  46. };
  47. //-----------------------------------------------------------------------------
  48. // Extra mouse codes
  49. //-----------------------------------------------------------------------------
  50. enum
  51. {
  52. MS_WM_XBUTTONDOWN = 0x020B,
  53. MS_WM_XBUTTONUP = 0x020C,
  54. MS_WM_XBUTTONDBLCLK = 0x020D,
  55. MS_MK_BUTTON4 = 0x0020,
  56. MS_MK_BUTTON5 = 0x0040,
  57. };
  58. //-----------------------------------------------------------------------------
  59. // Events
  60. //-----------------------------------------------------------------------------
  61. enum InputEventType_t
  62. {
  63. IE_ButtonPressed = 0, // m_nData contains a ButtonCode_t
  64. IE_ButtonReleased, // m_nData contains a ButtonCode_t
  65. IE_ButtonDoubleClicked, // m_nData contains a ButtonCode_t
  66. IE_AnalogValueChanged, // m_nData contains an AnalogCode_t, m_nData2 contains the value
  67. IE_FirstSystemEvent = 100,
  68. IE_Quit = IE_FirstSystemEvent,
  69. IE_ControllerInserted, // m_nData contains the controller ID
  70. IE_ControllerUnplugged, // m_nData contains the controller ID
  71. IE_Close,
  72. IE_WindowSizeChanged, // m_nData contains width, m_nData2 contains height, m_nData3 = 0 if not minimized, 1 if minimized
  73. IE_PS_CameraUnplugged, // m_nData contains code for type of disconnect.
  74. IE_PS_Move_OutOfView, // m_nData contains bool (0, 1) for whether the move is now out of view (1) or in view (0)
  75. IE_FirstUIEvent = 200,
  76. IE_LocateMouseClick = IE_FirstUIEvent,
  77. IE_SetCursor,
  78. IE_KeyTyped,
  79. IE_KeyCodeTyped,
  80. IE_InputLanguageChanged,
  81. IE_IMESetWindow,
  82. IE_IMEStartComposition,
  83. IE_IMEComposition,
  84. IE_IMEEndComposition,
  85. IE_IMEShowCandidates,
  86. IE_IMEChangeCandidates,
  87. IE_IMECloseCandidates,
  88. IE_IMERecomputeModes,
  89. IE_OverlayEvent,
  90. IE_FirstVguiEvent = 1000, // Assign ranges for other systems that post user events here
  91. IE_FirstAppEvent = 2000,
  92. };
  93. struct InputEvent_t
  94. {
  95. int m_nType; // Type of the event (see InputEventType_t)
  96. int m_nTick; // Tick on which the event occurred
  97. int m_nData; // Generic 32-bit data, what it contains depends on the event
  98. int m_nData2; // Generic 32-bit data, what it contains depends on the event
  99. int m_nData3; // Generic 32-bit data, what it contains depends on the event
  100. };
  101. //-----------------------------------------------------------------------------
  102. // Steam Controller Enums
  103. //-----------------------------------------------------------------------------
  104. #ifndef MAX_STEAM_CONTROLLERS
  105. #define MAX_STEAM_CONTROLLERS 16
  106. #endif
  107. typedef enum
  108. {
  109. SK_NULL,
  110. SK_BUTTON_A,
  111. SK_BUTTON_B,
  112. SK_BUTTON_X,
  113. SK_BUTTON_Y,
  114. SK_BUTTON_UP,
  115. SK_BUTTON_RIGHT,
  116. SK_BUTTON_DOWN,
  117. SK_BUTTON_LEFT,
  118. SK_BUTTON_LEFT_BUMPER,
  119. SK_BUTTON_RIGHT_BUMPER,
  120. SK_BUTTON_LEFT_TRIGGER,
  121. SK_BUTTON_RIGHT_TRIGGER,
  122. SK_BUTTON_LEFT_GRIP,
  123. SK_BUTTON_RIGHT_GRIP,
  124. SK_BUTTON_LPAD_TOUCH,
  125. SK_BUTTON_RPAD_TOUCH,
  126. SK_BUTTON_LPAD_CLICK,
  127. SK_BUTTON_RPAD_CLICK,
  128. SK_BUTTON_LPAD_UP,
  129. SK_BUTTON_LPAD_RIGHT,
  130. SK_BUTTON_LPAD_DOWN,
  131. SK_BUTTON_LPAD_LEFT,
  132. SK_BUTTON_RPAD_UP,
  133. SK_BUTTON_RPAD_RIGHT,
  134. SK_BUTTON_RPAD_DOWN,
  135. SK_BUTTON_RPAD_LEFT,
  136. SK_BUTTON_SELECT,
  137. SK_BUTTON_START,
  138. SK_BUTTON_STEAM,
  139. SK_BUTTON_INACTIVE_START,
  140. SK_MAX_KEYS
  141. } sKey_t;
  142. enum ESteamPadAxis
  143. {
  144. LEFTPAD_AXIS_X,
  145. LEFTPAD_AXIS_Y,
  146. RIGHTPAD_AXIS_X,
  147. RIGHTPAD_AXIS_Y,
  148. LEFT_TRIGGER_AXIS,
  149. RIGHT_TRIGGER_AXIS,
  150. GYRO_AXIS_PITCH,
  151. GYRO_AXIS_ROLL,
  152. GYRO_AXIS_YAW,
  153. MAX_STEAMPADAXIS = GYRO_AXIS_YAW
  154. };
  155. enum
  156. {
  157. LASTINPUT_KBMOUSE = 0,
  158. LASTINPUT_CONTROLLER = 1,
  159. LASTINPUT_STEAMCONTROLLER = 2
  160. };
  161. #endif // INPUTENUMS_H