CommonUsages.cs 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. using UnityEngine.InputSystem.Utilities;
  2. namespace UnityEngine.InputSystem
  3. {
  4. /// <summary>
  5. /// A collection of common usage string values as reported by <see cref="InputControl.usages"/>.
  6. /// </summary>
  7. public static class CommonUsages
  8. {
  9. /// <summary>
  10. /// Primary 2D motion control.
  11. /// </summary>
  12. /// <remarks>
  13. /// Example: left stick on gamepad.
  14. /// </remarks>
  15. public static readonly InternedString Primary2DMotion = new InternedString("Primary2DMotion");
  16. /// <summary>
  17. /// Secondary 2D motion control.
  18. /// </summary>
  19. /// <remarks>
  20. /// Example: right stick on gamepad.
  21. /// </remarks>
  22. public static readonly InternedString Secondary2DMotion = new InternedString("Secondary2DMotion");
  23. public static readonly InternedString PrimaryAction = new InternedString("PrimaryAction");
  24. public static readonly InternedString SecondaryAction = new InternedString("SecondaryAction");
  25. public static readonly InternedString PrimaryTrigger = new InternedString("PrimaryTrigger");
  26. public static readonly InternedString SecondaryTrigger = new InternedString("SecondaryTrigger");
  27. public static readonly InternedString Modifier = new InternedString("Modifier"); // Stuff like CTRL
  28. public static readonly InternedString Position = new InternedString("Position");
  29. public static readonly InternedString Orientation = new InternedString("Orientation");
  30. public static readonly InternedString Hatswitch = new InternedString("Hatswitch");
  31. /// <summary>
  32. /// Button to navigate to previous location.
  33. /// </summary>
  34. /// <remarks>
  35. /// Example: Escape on keyboard, B button on gamepad.
  36. ///
  37. /// In general, the "Back" control is used for moving backwards in the navigation history
  38. /// of a UI. This is used, for example, in hierarchical menu structures to move back to parent menus
  39. /// (e.g. from the "Settings" menu back to the "Main" menu). Consoles generally have stringent requirements
  40. /// as to which button has to fulfill this role.
  41. /// </remarks>
  42. public static readonly InternedString Back = new InternedString("Back");
  43. /// <summary>
  44. /// Button to navigate to next location.
  45. /// </summary>
  46. public static readonly InternedString Forward = new InternedString("Forward");
  47. /// <summary>
  48. /// Button to bring up menu.
  49. /// </summary>
  50. public static readonly InternedString Menu = new InternedString("Menu");
  51. /// <summary>
  52. /// Button to confirm the current choice.
  53. /// </summary>
  54. public static readonly InternedString Submit = new InternedString("Submit");
  55. ////REVIEW: isn't this the same as "Back"?
  56. /// <summary>
  57. /// Button to not accept the current choice.
  58. /// </summary>
  59. public static readonly InternedString Cancel = new InternedString("Cancel");
  60. /// <summary>
  61. /// Horizontal motion axis.
  62. /// </summary>
  63. /// <remarks>
  64. /// Example: X axis on mouse.
  65. /// </remarks>
  66. public static readonly InternedString Horizontal = new InternedString("Horizontal");
  67. /// <summary>
  68. /// Vertical motion axis.
  69. /// </summary>
  70. /// <remarks>
  71. /// Example: Y axis on mouse.
  72. /// </remarks>
  73. public static readonly InternedString Vertical = new InternedString("Vertical");
  74. /// <summary>
  75. /// Rotation around single, fixed axis.
  76. /// </summary>
  77. /// <remarks>
  78. /// Example: twist on joystick or twist of pen (few pens support that).
  79. /// </remarks>
  80. public static readonly InternedString Twist = new InternedString("Twist");
  81. /// <summary>
  82. /// Pressure level axis.
  83. /// </summary>
  84. /// <remarks>
  85. /// Example: pen pressure.
  86. /// </remarks>
  87. public static readonly InternedString Pressure = new InternedString("Pressure");
  88. /// <summary>
  89. /// Axis to scroll horizontally.
  90. /// </summary>
  91. public static readonly InternedString ScrollHorizontal = new InternedString("ScrollHorizontal");
  92. /// <summary>
  93. /// Axis to scroll vertically.
  94. /// </summary>
  95. public static readonly InternedString ScrollVertical = new InternedString("ScrollVertical");
  96. public static readonly InternedString Point = new InternedString("Point");
  97. public static readonly InternedString LowFreqMotor = new InternedString("LowFreqMotor");
  98. public static readonly InternedString HighFreqMotor = new InternedString("HighFreqMotor");
  99. /// <summary>
  100. /// Device in left hand.
  101. /// </summary>
  102. /// <remarks>
  103. /// Example: left hand XR controller.
  104. /// </remarks>
  105. public static readonly InternedString LeftHand = new InternedString("LeftHand");
  106. /// <summary>
  107. /// Device in right hand.
  108. /// </summary>
  109. /// <remarks>
  110. /// Example: right hand XR controller.
  111. /// </remarks>
  112. public static readonly InternedString RightHand = new InternedString("RightHand");
  113. /// <summary>
  114. /// Axis representing charge of battery (1=full, 0=empty).
  115. /// </summary>
  116. public static readonly InternedString BatteryStrength = new InternedString("BatteryStrength");
  117. }
  118. }