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