controller_type.h 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. /*
  2. Copyright (C) Valve Corporation
  3. This software is provided 'as-is', without any express or implied
  4. warranty. In no event will the authors be held liable for any damages
  5. arising from the use of this software.
  6. Permission is granted to anyone to use this software for any purpose,
  7. including commercial applications, and to alter it and redistribute it
  8. freely, subject to the following restrictions:
  9. 1. The origin of this software must not be misrepresented; you must not
  10. claim that you wrote the original software. If you use this software
  11. in a product, an acknowledgment in the product documentation would be
  12. appreciated but is not required.
  13. 2. Altered source versions must be plainly marked as such, and must not be
  14. misrepresented as being the original software.
  15. 3. This notice may not be removed or altered from any source distribution.
  16. */
  17. #ifndef CONTROLLER_TYPE_H
  18. #define CONTROLLER_TYPE_H
  19. #ifdef _WIN32
  20. #pragma once
  21. #endif
  22. //-----------------------------------------------------------------------------
  23. // Purpose: Steam Controller models
  24. // WARNING: DO NOT RENUMBER EXISTING VALUES - STORED IN A DATABASE
  25. //-----------------------------------------------------------------------------
  26. typedef enum
  27. {
  28. k_eControllerType_None = -1,
  29. k_eControllerType_Unknown = 0,
  30. // Steam Controllers
  31. k_eControllerType_UnknownSteamController = 1,
  32. k_eControllerType_SteamController = 2,
  33. k_eControllerType_SteamControllerV2 = 3,
  34. // Other Controllers
  35. k_eControllerType_UnknownNonSteamController = 30,
  36. k_eControllerType_XBox360Controller = 31,
  37. k_eControllerType_XBoxOneController = 32,
  38. k_eControllerType_PS3Controller = 33,
  39. k_eControllerType_PS4Controller = 34,
  40. k_eControllerType_WiiController = 35,
  41. k_eControllerType_AppleController = 36,
  42. k_eControllerType_AndroidController = 37,
  43. k_eControllerType_SwitchProController = 38,
  44. k_eControllerType_SwitchJoyConLeft = 39,
  45. k_eControllerType_SwitchJoyConRight = 40,
  46. k_eControllerType_SwitchJoyConPair = 41,
  47. k_eControllerType_SwitchInputOnlyController = 42,
  48. k_eControllerType_MobileTouch = 43,
  49. k_eControllerType_XInputSwitchController = 44, // Client-side only, used to mark Nintendo Switch style controllers as using XInput instead of the Nintendo Switch protocol
  50. k_eControllerType_PS5Controller = 45,
  51. k_eControllerType_XInputPS4Controller = 46, // Client-side only, used to mark DualShock 4 style controllers using XInput instead of the DualShock 4 controller protocol
  52. k_eControllerType_LastController, // Don't add game controllers below this enumeration - this enumeration can change value
  53. // Keyboards and Mice
  54. k_eControllertype_GenericKeyboard = 400,
  55. k_eControllertype_GenericMouse = 800,
  56. } EControllerType;
  57. typedef struct
  58. {
  59. unsigned int m_unDeviceID;
  60. EControllerType m_eControllerType;
  61. const char *m_pszName;
  62. } ControllerDescription_t;
  63. extern EControllerType GuessControllerType( int nVID, int nPID );
  64. extern const char *GuessControllerName( int nVID, int nPID );
  65. #endif // CONTROLLER_TYPE_H