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.

53 lines
2.3 KiB

  1. // ===== Copyright 1996-2012, Valve Corporation, All rights reserved. =======
  2. //
  3. // Purpose:
  4. //
  5. //===========================================================================//
  6. #ifndef PLATFORMINPUTDEVICE_H
  7. #define PLATFORMINPUTDEVICE_H
  8. #ifdef _WIN32
  9. #pragma once
  10. #endif
  11. #include "basetypes.h"
  12. #include "platform.h"
  13. #include "input_device.h"
  14. class PlatformInputDevice
  15. {
  16. public:
  17. static bool s_Initialized;
  18. static InputDevice_t s_validPlatformInputDevices[INPUT_DEVICE_PLATFORM_COUNT];
  19. static int s_numberPlatformInputDevices[INPUT_DEVICE_PLATFORM_COUNT];
  20. static InputDevice_t s_AllInputDevices;
  21. static const InputDevicePlatform_t s_LocalInputPlatform;
  22. static void InitPlatfromInputDeviceInfo( void );
  23. // Generic Information functions that can handle other platforms
  24. // Input Device information functions
  25. static int GetInputDeviceCountforPlatform( InputDevicePlatform_t platform = INPUT_DEVICE_PLATFORM_LOCAL );
  26. static InputDevice_t GetValidInputDevicesForPlatform( InputDevicePlatform_t platform = INPUT_DEVICE_PLATFORM_LOCAL );
  27. static bool IsInputDeviceValid( InputDevice_t device, InputDevicePlatform_t platform = INPUT_DEVICE_PLATFORM_ANY );
  28. static const char *GetInputDeviceNameUI( InputDevice_t device ); // Use me to get translated, specific name
  29. static const char *GetInputDeviceNameInternal( InputDevice_t device ); // Use me for internal usage w/ consistency
  30. // Input platform information functions
  31. static InputDevicePlatform_t GetLocalInputDevicePlatform( void );
  32. static bool IsInputDevicePlatformValid( InputDevicePlatform_t platform );
  33. static const char *GetInputDevicePlatformName( InputDevicePlatform_t platform );
  34. static InputDevice_t GetDefaultInputDeviceForPlatform( InputDevicePlatform_t platform = INPUT_DEVICE_PLATFORM_LOCAL );
  35. // methods to convert to/from an InputDevice_t and a 1-based ordinal
  36. static int GetInputDeviceOrdinalForPlatform( InputDevice_t device, InputDevicePlatform_t platform = INPUT_DEVICE_PLATFORM_LOCAL );
  37. static InputDevice_t GetInputDeviceTypefromPlatformOrdinal( int deviceNo, InputDevicePlatform_t platform = INPUT_DEVICE_PLATFORM_LOCAL );
  38. // input device properties
  39. static bool IsInputDeviceAPointer( InputDevice_t device ); // Returns true if the device is treated as a pointer for input.
  40. };
  41. #endif // PLATFORMINPUTDEVICE_H