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.

80 lines
2.9 KiB

  1. //========= Copyright 2012, Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //
  7. //=============================================================================//
  8. #ifndef INPUT_DEVICES_H
  9. #define INPUT_DEVICES_H
  10. #ifdef _WIN32
  11. #pragma once
  12. #endif
  13. #if defined( _PS3 )
  14. #include <limits.h>
  15. #endif
  16. // [dkorus]: The values here are setup to be used as a bit-field.
  17. // for example: A PS3 with a KEYBOARD_MOUSE attached as well as a PLAYSTATION_MOVE would have a connected
  18. // device bitfield of 5 (4 for playstation move, 1 for the keyboard/mouse, for 4+1==5)
  19. // when adding new entries, make sure they are a power of 2.
  20. enum InputDevice_t
  21. {
  22. INPUT_DEVICE_NONE = 0, // (0) no specific device is selected
  23. INPUT_DEVICE_KEYBOARD_MOUSE = 1 << 0, // (1) considered connected if BOTH INPUT_DEVICE_KEYBOARD and INPUT_DEVICE_MOUSE are connected
  24. INPUT_DEVICE_GAMEPAD = 1 << 1, // (2) includes PS3, XBox360, or 360 gamepad connected to PC
  25. INPUT_DEVICE_PLAYSTATION_MOVE = 1 << 2, // (4) PS3 only
  26. INPUT_DEVICE_HYDRA = 1 << 3, // (8) support on PC
  27. INPUT_DEVICE_SHARPSHOOTER = 1 << 4, // (16) PS3 only
  28. INPUT_DEVICE_MOVE_NAV_CONTROLLER = 1 << 5, // (32) PS3 only
  29. INPUT_DEVICE_STEAM_CONTROLLER = 1 << 6, // (64) Steam controller
  30. INPUT_DEVICE_MAX,
  31. INPUT_DEVICE_INVALID = INPUT_DEVICE_MAX,
  32. INPUT_DEVICE_FORCE_INT32 = INT32_MAX
  33. };
  34. DEFINE_ENUM_BITWISE_OPERATORS( InputDevice_t )
  35. // [mpritchard]: When we are talking about input devices, we also have an implicit, or explicit, platform
  36. // that we are talking about because the list of possible input devices is specific to and varies by the
  37. // the platform of the player. We can't just use the platform that the code is compiled for because
  38. // some code which may be running on a dedicated server which can be a platform than the clients:
  39. // Specifically, that the dedicated server for Xbox360 and PS3 clients is compiled for and runs on
  40. // either a windows PC or LINUX. For this reason, we need a server on one platform to be able ask
  41. // what are the valid input devices for this other platform...
  42. //
  43. enum InputDevicePlatform_t
  44. {
  45. INPUT_DEVICE_PLATFORM_ANY = -2,
  46. INPUT_DEVICE_PLATFORM_LOCAL = -1,
  47. INPUT_DEVICE_PLATFORM_NONE = 0, // Allows for a undefined platform
  48. INPUT_DEVICE_PLATFORM_WINDOWS,
  49. INPUT_DEVICE_PLATFORM_OSX,
  50. INPUT_DEVICE_PLATFORM_XBOX360,
  51. INPUT_DEVICE_PLATFORM_PS3,
  52. INPUT_DEVICE_PLATFORM_LINUX,
  53. INPUT_DEVICE_PLATFORM_COUNT, // list auto counter
  54. INPUT_DEVICE_PLATFORM_FORCE_INT32 = INT32_MAX
  55. };
  56. // motion controller state
  57. enum InputDeviceMCState
  58. {
  59. INPUT_DEVICE_MC_STATE_CAMERA_NOT_CONNECTED = -1,
  60. INPUT_DEVICE_MC_STATE_CONTROLLER_NOT_CONNECTED,
  61. INPUT_DEVICE_MC_STATE_CONTROLLER_NOT_CALIBRATED,
  62. INPUT_DEVICE_MC_STATE_CONTROLLER_CALIBRATING,
  63. INPUT_DEVICE_MC_STATE_CONTROLLER_ERROR,
  64. INPUT_DEVICE_MC_STATE_OK,
  65. };
  66. #endif //INPUT_DEVICES_H