DualShockGamepadHID.cs 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614
  1. #if UNITY_EDITOR || UNITY_STANDALONE_OSX || UNITY_STANDALONE_WIN || UNITY_WSA || PACKAGE_DOCS_GENERATION
  2. using System;
  3. using System.Runtime.InteropServices;
  4. using UnityEngine.InputSystem.Controls;
  5. using UnityEngine.InputSystem.Layouts;
  6. using UnityEngine.InputSystem.LowLevel;
  7. using UnityEngine.InputSystem.DualShock.LowLevel;
  8. using UnityEngine.InputSystem.Utilities;
  9. ////TODO: figure out sensor formats and add support for acceleration, angularVelocity, and orientation (also add to base layout then)
  10. namespace UnityEngine.InputSystem.DualShock.LowLevel
  11. {
  12. /// <summary>
  13. /// Structure of HID input reports for PS4 DualShock 4 controllers.
  14. /// </summary>
  15. [StructLayout(LayoutKind.Explicit, Size = 32)]
  16. internal struct DualShock4HIDInputReport : IInputStateTypeInfo
  17. {
  18. [FieldOffset(0)] public byte reportId;
  19. [InputControl(name = "leftStick", layout = "Stick", format = "VC2B")]
  20. [InputControl(name = "leftStick/x", offset = 0, format = "BYTE", parameters = "normalize,normalizeMin=0,normalizeMax=1,normalizeZero=0.5")]
  21. [InputControl(name = "leftStick/left", offset = 0, format = "BYTE", parameters = "normalize,normalizeMin=0,normalizeMax=1,normalizeZero=0.5,clamp=1,clampMin=0,clampMax=0.5,invert")]
  22. [InputControl(name = "leftStick/right", offset = 0, format = "BYTE", parameters = "normalize,normalizeMin=0,normalizeMax=1,normalizeZero=0.5,clamp=1,clampMin=0.5,clampMax=1")]
  23. [InputControl(name = "leftStick/y", offset = 1, format = "BYTE", parameters = "invert,normalize,normalizeMin=0,normalizeMax=1,normalizeZero=0.5")]
  24. [InputControl(name = "leftStick/up", offset = 1, format = "BYTE", parameters = "normalize,normalizeMin=0,normalizeMax=1,normalizeZero=0.5,clamp=1,clampMin=0,clampMax=0.5,invert")]
  25. [InputControl(name = "leftStick/down", offset = 1, format = "BYTE", parameters = "normalize,normalizeMin=0,normalizeMax=1,normalizeZero=0.5,clamp=1,clampMin=0.5,clampMax=1,invert=false")]
  26. [FieldOffset(1)] public byte leftStickX;
  27. [FieldOffset(2)] public byte leftStickY;
  28. [InputControl(name = "rightStick", layout = "Stick", format = "VC2B")]
  29. [InputControl(name = "rightStick/x", offset = 0, format = "BYTE", parameters = "normalize,normalizeMin=0,normalizeMax=1,normalizeZero=0.5")]
  30. [InputControl(name = "rightStick/left", offset = 0, format = "BYTE", parameters = "normalize,normalizeMin=0,normalizeMax=1,normalizeZero=0.5,clamp=1,clampMin=0,clampMax=0.5,invert")]
  31. [InputControl(name = "rightStick/right", offset = 0, format = "BYTE", parameters = "normalize,normalizeMin=0,normalizeMax=1,normalizeZero=0.5,clamp=1,clampMin=0.5,clampMax=1")]
  32. [InputControl(name = "rightStick/y", offset = 1, format = "BYTE", parameters = "invert,normalize,normalizeMin=0,normalizeMax=1,normalizeZero=0.5")]
  33. [InputControl(name = "rightStick/up", offset = 1, format = "BYTE", parameters = "normalize,normalizeMin=0,normalizeMax=1,normalizeZero=0.5,clamp=1,clampMin=0,clampMax=0.5,invert")]
  34. [InputControl(name = "rightStick/down", offset = 1, format = "BYTE", parameters = "normalize,normalizeMin=0,normalizeMax=1,normalizeZero=0.5,clamp=1,clampMin=0.5,clampMax=1,invert=false")]
  35. [FieldOffset(3)] public byte rightStickX;
  36. [FieldOffset(4)] public byte rightStickY;
  37. [InputControl(name = "dpad", format = "BIT", layout = "Dpad", sizeInBits = 4, defaultState = 8)]
  38. [InputControl(name = "dpad/up", format = "BIT", layout = "DiscreteButton", parameters = "minValue=7,maxValue=1,nullValue=8,wrapAtValue=7", bit = 0, sizeInBits = 4)]
  39. [InputControl(name = "dpad/right", format = "BIT", layout = "DiscreteButton", parameters = "minValue=1,maxValue=3", bit = 0, sizeInBits = 4)]
  40. [InputControl(name = "dpad/down", format = "BIT", layout = "DiscreteButton", parameters = "minValue=3,maxValue=5", bit = 0, sizeInBits = 4)]
  41. [InputControl(name = "dpad/left", format = "BIT", layout = "DiscreteButton", parameters = "minValue=5, maxValue=7", bit = 0, sizeInBits = 4)]
  42. [InputControl(name = "buttonWest", displayName = "Square", bit = 4)]
  43. [InputControl(name = "buttonSouth", displayName = "Cross", bit = 5)]
  44. [InputControl(name = "buttonEast", displayName = "Circle", bit = 6)]
  45. [InputControl(name = "buttonNorth", displayName = "Triangle", bit = 7)]
  46. [FieldOffset(5)] public byte buttons1;
  47. [InputControl(name = "leftShoulder", bit = 0)]
  48. [InputControl(name = "rightShoulder", bit = 1)]
  49. [InputControl(name = "leftTriggerButton", layout = "Button", bit = 2)]
  50. [InputControl(name = "rightTriggerButton", layout = "Button", bit = 3)]
  51. [InputControl(name = "select", displayName = "Share", bit = 4)]
  52. [InputControl(name = "start", displayName = "Options", bit = 5)]
  53. [InputControl(name = "leftStickPress", bit = 6)]
  54. [InputControl(name = "rightStickPress", bit = 7)]
  55. [FieldOffset(6)] public byte buttons2;
  56. [InputControl(name = "systemButton", layout = "Button", displayName = "System", bit = 0)]
  57. [InputControl(name = "touchpadButton", layout = "Button", displayName = "Touchpad Press", bit = 1)]
  58. [FieldOffset(7)] public byte buttons3;
  59. [InputControl(name = "leftTrigger", format = "BYTE")]
  60. [FieldOffset(8)] public byte leftTrigger;
  61. [InputControl(name = "rightTrigger", format = "BYTE")]
  62. [FieldOffset(9)] public byte rightTrigger;
  63. [FieldOffset(30)] public byte batteryLevel;
  64. ////TODO: touchpad
  65. public FourCC format => new FourCC('H', 'I', 'D');
  66. }
  67. /// <summary>
  68. /// Structure of HID input reports for PS3 DualShock 3 controllers.
  69. /// </summary>
  70. [StructLayout(LayoutKind.Explicit, Size = 32)]
  71. internal unsafe struct DualShock3HIDInputReport : IInputStateTypeInfo
  72. {
  73. [FieldOffset(0)] private ushort padding1;
  74. [InputControl(name = "select", displayName = "Share", bit = 0)]
  75. [InputControl(name = "leftStickPress", bit = 1)]
  76. [InputControl(name = "rightStickPress", bit = 2)]
  77. [InputControl(name = "start", displayName = "Options", bit = 3)]
  78. [InputControl(name = "dpad", format = "BIT", layout = "Dpad", bit = 4, sizeInBits = 4)]
  79. [InputControl(name = "dpad/up", bit = 4)]
  80. [InputControl(name = "dpad/right", bit = 5)]
  81. [InputControl(name = "dpad/down", bit = 6)]
  82. [InputControl(name = "dpad/left", bit = 7)]
  83. [FieldOffset(2)] public byte buttons1;
  84. [InputControl(name = "leftTriggerButton", layout = "Button", bit = 0)]
  85. [InputControl(name = "rightTriggerButton", layout = "Button", bit = 1)]
  86. [InputControl(name = "leftShoulder", bit = 2)]
  87. [InputControl(name = "rightShoulder", bit = 3)]
  88. [InputControl(name = "buttonNorth", displayName = "Triangle", bit = 4)]
  89. [InputControl(name = "buttonEast", displayName = "Circle", bit = 5)]
  90. [InputControl(name = "buttonSouth", displayName = "Cross", bit = 6)]
  91. [InputControl(name = "buttonWest", displayName = "Square", bit = 7)]
  92. [FieldOffset(3)] public byte buttons2;
  93. [InputControl(name = "systemButton", layout = "Button", displayName = "System", bit = 0)]
  94. [InputControl(name = "touchpadButton", layout = "Button", displayName = "Touchpad Press", bit = 1)] // always 0, does not exist on DualShock 3
  95. [FieldOffset(4)] public byte buttons3;
  96. [FieldOffset(5)] private byte padding2;
  97. [InputControl(name = "leftStick", layout = "Stick", format = "VC2B")]
  98. [InputControl(name = "leftStick/x", offset = 0, format = "BYTE", parameters = "normalize,normalizeMin=0,normalizeMax=1,normalizeZero=0.5")]
  99. [InputControl(name = "leftStick/left", offset = 0, format = "BYTE", parameters = "normalize,normalizeMin=0,normalizeMax=1,normalizeZero=0.5,clamp=1,clampMin=0,clampMax=0.5,invert")]
  100. [InputControl(name = "leftStick/right", offset = 0, format = "BYTE", parameters = "normalize,normalizeMin=0,normalizeMax=1,normalizeZero=0.5,clamp=1,clampMin=0.5,clampMax=1")]
  101. [InputControl(name = "leftStick/y", offset = 1, format = "BYTE", parameters = "invert,normalize,normalizeMin=0,normalizeMax=1,normalizeZero=0.5")]
  102. [InputControl(name = "leftStick/up", offset = 1, format = "BYTE", parameters = "normalize,normalizeMin=0,normalizeMax=1,normalizeZero=0.5,clamp=1,clampMin=0,clampMax=0.5,invert")]
  103. [InputControl(name = "leftStick/down", offset = 1, format = "BYTE", parameters = "normalize,normalizeMin=0,normalizeMax=1,normalizeZero=0.5,clamp=1,clampMin=0.5,clampMax=1,invert=false")]
  104. [FieldOffset(6)] public byte leftStickX;
  105. [FieldOffset(7)] public byte leftStickY;
  106. [InputControl(name = "rightStick", layout = "Stick", format = "VC2B")]
  107. [InputControl(name = "rightStick/x", offset = 0, format = "BYTE", parameters = "normalize,normalizeMin=0,normalizeMax=1,normalizeZero=0.5")]
  108. [InputControl(name = "rightStick/left", offset = 0, format = "BYTE", parameters = "normalize,normalizeMin=0,normalizeMax=1,normalizeZero=0.5,clamp=1,clampMin=0,clampMax=0.5,invert")]
  109. [InputControl(name = "rightStick/right", offset = 0, format = "BYTE", parameters = "normalize,normalizeMin=0,normalizeMax=1,normalizeZero=0.5,clamp=1,clampMin=0.5,clampMax=1")]
  110. [InputControl(name = "rightStick/y", offset = 1, format = "BYTE", parameters = "invert,normalize,normalizeMin=0,normalizeMax=1,normalizeZero=0.5")]
  111. [InputControl(name = "rightStick/up", offset = 1, format = "BYTE", parameters = "normalize,normalizeMin=0,normalizeMax=1,normalizeZero=0.5,clamp=1,clampMin=0,clampMax=0.5,invert")]
  112. [InputControl(name = "rightStick/down", offset = 1, format = "BYTE", parameters = "normalize,normalizeMin=0,normalizeMax=1,normalizeZero=0.5,clamp=1,clampMin=0.5,clampMax=1,invert=false")]
  113. [FieldOffset(8)] public byte rightStickX;
  114. [FieldOffset(9)] public byte rightStickY;
  115. [FieldOffset(10)] private fixed byte padding3[8];
  116. [InputControl(name = "leftTrigger", format = "BYTE")]
  117. [FieldOffset(18)] public byte leftTrigger;
  118. [InputControl(name = "rightTrigger", format = "BYTE")]
  119. [FieldOffset(19)] public byte rightTrigger;
  120. public FourCC format
  121. {
  122. get { return new FourCC('H', 'I', 'D'); }
  123. }
  124. }
  125. /// <summary>
  126. /// PS4 output report sent as command to HID backend.
  127. /// </summary>
  128. [StructLayout(LayoutKind.Explicit, Size = kSize)]
  129. internal unsafe struct DualShockHIDOutputReport : IInputDeviceCommandInfo
  130. {
  131. public static FourCC Type => new FourCC('H', 'I', 'D', 'O');
  132. internal const int kSize = InputDeviceCommand.kBaseCommandSize + 32;
  133. internal const int kReportId = 5;
  134. [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1726:UsePreferredTerms", MessageId = "Flags", Justification = "No better term for underlying data.")]
  135. [Flags]
  136. public enum Flags
  137. {
  138. Rumble = 0x1,
  139. Color = 0x2
  140. }
  141. [FieldOffset(0)] public InputDeviceCommand baseCommand;
  142. [FieldOffset(InputDeviceCommand.kBaseCommandSize + 0)] public byte reportId;
  143. [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1726:UsePreferredTerms", MessageId = "flags", Justification = "No better term for underlying data.")]
  144. [FieldOffset(InputDeviceCommand.kBaseCommandSize + 1)] public byte flags;
  145. [FieldOffset(InputDeviceCommand.kBaseCommandSize + 2)] public fixed byte unknown1[2];
  146. [FieldOffset(InputDeviceCommand.kBaseCommandSize + 4)] public byte highFrequencyMotorSpeed;
  147. [FieldOffset(InputDeviceCommand.kBaseCommandSize + 5)] public byte lowFrequencyMotorSpeed;
  148. [FieldOffset(InputDeviceCommand.kBaseCommandSize + 6)] public byte redColor;
  149. [FieldOffset(InputDeviceCommand.kBaseCommandSize + 7)] public byte greenColor;
  150. [FieldOffset(InputDeviceCommand.kBaseCommandSize + 8)] public byte blueColor;
  151. [FieldOffset(InputDeviceCommand.kBaseCommandSize + 9)] public fixed byte unknown2[23];
  152. public FourCC typeStatic => Type;
  153. public void SetMotorSpeeds(float lowFreq, float highFreq)
  154. {
  155. flags |= (byte)Flags.Rumble;
  156. lowFrequencyMotorSpeed = (byte)Mathf.Clamp(lowFreq * 255, 0, 255);
  157. highFrequencyMotorSpeed = (byte)Mathf.Clamp(highFreq * 255, 0, 255);
  158. }
  159. public void SetColor(Color color)
  160. {
  161. flags |= (byte)Flags.Color;
  162. redColor = (byte)Mathf.Clamp(color.r * 255, 0, 255);
  163. greenColor = (byte)Mathf.Clamp(color.g * 255, 0, 255);
  164. blueColor = (byte)Mathf.Clamp(color.b * 255, 0, 255);
  165. }
  166. public static DualShockHIDOutputReport Create()
  167. {
  168. return new DualShockHIDOutputReport
  169. {
  170. baseCommand = new InputDeviceCommand(Type, kSize),
  171. reportId = kReportId,
  172. };
  173. }
  174. }
  175. }
  176. namespace UnityEngine.InputSystem.DualShock
  177. {
  178. /// <summary>
  179. /// PS4 DualShock controller that is interfaced to a HID backend.
  180. /// </summary>
  181. [InputControlLayout(stateType = typeof(DualShock4HIDInputReport), hideInUI = true)]
  182. [Scripting.Preserve]
  183. public class DualShock4GamepadHID : DualShockGamepad
  184. {
  185. public ButtonControl leftTriggerButton { get; private set; }
  186. public ButtonControl rightTriggerButton { get; private set; }
  187. public ButtonControl playStationButton { get; private set; }
  188. protected override void FinishSetup()
  189. {
  190. leftTriggerButton = GetChildControl<ButtonControl>("leftTriggerButton");
  191. rightTriggerButton = GetChildControl<ButtonControl>("rightTriggerButton");
  192. playStationButton = GetChildControl<ButtonControl>("systemButton");
  193. base.FinishSetup();
  194. }
  195. public override void PauseHaptics()
  196. {
  197. if (!m_LowFrequencyMotorSpeed.HasValue && !m_HighFrequenceyMotorSpeed.HasValue && !m_LightBarColor.HasValue)
  198. return;
  199. var command = DualShockHIDOutputReport.Create();
  200. command.SetMotorSpeeds(0f, 0f);
  201. ////REVIEW: when pausing&resuming haptics, you probably don't want the lightbar color to change
  202. if (m_LightBarColor.HasValue)
  203. command.SetColor(Color.black);
  204. ExecuteCommand(ref command);
  205. }
  206. public override void ResetHaptics()
  207. {
  208. if (!m_LowFrequencyMotorSpeed.HasValue && !m_HighFrequenceyMotorSpeed.HasValue && !m_LightBarColor.HasValue)
  209. return;
  210. var command = DualShockHIDOutputReport.Create();
  211. command.SetMotorSpeeds(0f, 0f);
  212. if (m_LightBarColor.HasValue)
  213. command.SetColor(Color.black);
  214. ExecuteCommand(ref command);
  215. m_HighFrequenceyMotorSpeed = null;
  216. m_LowFrequencyMotorSpeed = null;
  217. m_LightBarColor = null;
  218. }
  219. public override void ResumeHaptics()
  220. {
  221. if (!m_LowFrequencyMotorSpeed.HasValue && !m_HighFrequenceyMotorSpeed.HasValue && !m_LightBarColor.HasValue)
  222. return;
  223. var command = DualShockHIDOutputReport.Create();
  224. if (m_LowFrequencyMotorSpeed.HasValue || m_HighFrequenceyMotorSpeed.HasValue)
  225. command.SetMotorSpeeds(m_LowFrequencyMotorSpeed.Value, m_HighFrequenceyMotorSpeed.Value);
  226. if (m_LightBarColor.HasValue)
  227. command.SetColor(m_LightBarColor.Value);
  228. ExecuteCommand(ref command);
  229. }
  230. public override void SetLightBarColor(Color color)
  231. {
  232. var command = DualShockHIDOutputReport.Create();
  233. command.SetColor(color);
  234. ExecuteCommand(ref command);
  235. m_LightBarColor = color;
  236. }
  237. public override void SetMotorSpeeds(float lowFrequency, float highFrequency)
  238. {
  239. var command = DualShockHIDOutputReport.Create();
  240. command.SetMotorSpeeds(lowFrequency, highFrequency);
  241. ExecuteCommand(ref command);
  242. m_LowFrequencyMotorSpeed = lowFrequency;
  243. m_HighFrequenceyMotorSpeed = highFrequency;
  244. }
  245. private float? m_LowFrequencyMotorSpeed;
  246. private float? m_HighFrequenceyMotorSpeed;
  247. private Color? m_LightBarColor;
  248. }
  249. [InputControlLayout(stateType = typeof(DualShock3HIDInputReport), hideInUI = true)]
  250. [Scripting.Preserve]
  251. public class DualShock3GamepadHID : DualShockGamepad
  252. {
  253. public ButtonControl leftTriggerButton { get; private set; }
  254. public ButtonControl rightTriggerButton { get; private set; }
  255. public ButtonControl playStationButton { get; private set; }
  256. protected override void FinishSetup()
  257. {
  258. leftTriggerButton = GetChildControl<ButtonControl>("leftTriggerButton");
  259. rightTriggerButton = GetChildControl<ButtonControl>("rightTriggerButton");
  260. playStationButton = GetChildControl<ButtonControl>("systemButton");
  261. base.FinishSetup();
  262. }
  263. // TODO: see if we can implement rumble support on DualShock 3
  264. }
  265. }
  266. // PS4 HID structures:
  267. //
  268. // struct PS4InputReport1
  269. // {
  270. // byte reportId; // #0
  271. // byte leftStickX; // #1
  272. // byte leftStickY; // #2
  273. // byte rightStickX; // #3
  274. // byte rightStickY; // #4
  275. // byte dpad : 4; // #5 bit #0 (0=up, 2=right, 4=down, 6=left)
  276. // byte squareButton : 1; // #5 bit #4
  277. // byte crossButton : 1; // #5 bit #5
  278. // byte circleButton : 1; // #5 bit #6
  279. // byte triangleButton : 1; // #5 bit #7
  280. // byte leftShoulder : 1; // #6 bit #0
  281. // byte rightShoulder : 1; // #6 bit #1
  282. // byte leftTriggerButton : 2;// #6 bit #2
  283. // byte rightTriggerButton : 2;// #6 bit #3
  284. // byte shareButton : 1; // #6 bit #4
  285. // byte optionsButton : 1; // #6 bit #5
  286. // byte leftStickPress : 1; // #6 bit #6
  287. // byte rightStickPress : 1; // #6 bit #7
  288. // byte psButton : 1; // #7 bit #0
  289. // byte touchpadPress : 1; // #7 bit #1
  290. // byte padding : 6;
  291. // byte leftTrigger; // #8
  292. // byte rightTrigger; // #9
  293. // }
  294. //
  295. // struct PS4OutputReport5
  296. // {
  297. // byte reportId; // #0
  298. // byte flags; // #1
  299. // byte unknown1[2];
  300. // byte highFrequencyMotor; // #4
  301. // byte lowFrequencyMotor; // #5
  302. // byte redColor; // #6
  303. // byte greenColor; // #7
  304. // byte blueColor; // #8
  305. // byte unknown2[23];
  306. // }
  307. //
  308. // Raw HID report descriptor:
  309. //
  310. // Usage Page (Generic Desktop) 05 01
  311. // Usage (Game Pad) 09 05
  312. // Collection (Application) A1 01
  313. // Report ID (1) 85 01
  314. // Usage (X) 09 30
  315. // Usage (Y) 09 31
  316. // Usage (Z) 09 32
  317. // Usage (Rz) 09 35
  318. // Logical Minimum (0) 15 00
  319. // Logical Maximum (255) 26 FF 00
  320. // Report Size (8) 75 08
  321. // Report Count (4) 95 04
  322. // Input (Data,Var,Abs,NWrp,Lin,Pref,NNul,Bit) 81 02
  323. // Usage (Hat Switch) 09 39
  324. // Logical Minimum (0) 15 00
  325. // Logical Maximum (7) 25 07
  326. // Physical Minimum (0) 35 00
  327. // Physical Maximum (315) 46 3B 01
  328. // Unit (Eng Rot: Degree) 65 14
  329. // Report Size (4) 75 04
  330. // Report Count (1) 95 01
  331. // Input (Data,Var,Abs,NWrp,Lin,Pref,Null,Bit) 81 42
  332. // Unit (None) 65 00
  333. // Usage Page (Button) 05 09
  334. // Usage Minimum (Button 1) 19 01
  335. // Usage Maximum (Button 14) 29 0E
  336. // Logical Minimum (0) 15 00
  337. // Logical Maximum (1) 25 01
  338. // Report Size (1) 75 01
  339. // Report Count (14) 95 0E
  340. // Input (Data,Var,Abs,NWrp,Lin,Pref,NNul,Bit) 81 02
  341. // Usage Page (Vendor-Defined 1) 06 00 FF
  342. // Usage (Vendor-Defined 32) 09 20
  343. // Report Size (6) 75 06
  344. // Report Count (1) 95 01
  345. // Logical Minimum (0) 15 00
  346. // Logical Maximum (127) 25 7F
  347. // Input (Data,Var,Abs,NWrp,Lin,Pref,NNul,Bit) 81 02
  348. // Usage Page (Generic Desktop) 05 01
  349. // Usage (Rx) 09 33
  350. // Usage (Ry) 09 34
  351. // Logical Minimum (0) 15 00
  352. // Logical Maximum (255) 26 FF 00
  353. // Report Size (8) 75 08
  354. // Report Count (2) 95 02
  355. // Input (Data,Var,Abs,NWrp,Lin,Pref,NNul,Bit) 81 02
  356. // Usage Page (Vendor-Defined 1) 06 00 FF
  357. // Usage (Vendor-Defined 33) 09 21
  358. // Report Count (54) 95 36
  359. // Input (Data,Var,Abs,NWrp,Lin,Pref,NNul,Bit) 81 02
  360. // Report ID (5) 85 05
  361. // Usage (Vendor-Defined 34) 09 22
  362. // Report Count (31) 95 1F
  363. // Output (Data,Var,Abs,NWrp,Lin,Pref,NNul,NVol,Bit) 91 02
  364. // Report ID (4) 85 04
  365. // Usage (Vendor-Defined 35) 09 23
  366. // Report Count (36) 95 24
  367. // Feature (Data,Var,Abs,NWrp,Lin,Pref,NNul,NVol,Bit) B1 02
  368. // Report ID (2) 85 02
  369. // Usage (Vendor-Defined 36) 09 24
  370. // Report Count (36) 95 24
  371. // Feature (Data,Var,Abs,NWrp,Lin,Pref,NNul,NVol,Bit) B1 02
  372. // Report ID (8) 85 08
  373. // Usage (Vendor-Defined 37) 09 25
  374. // Report Count (3) 95 03
  375. // Feature (Data,Var,Abs,NWrp,Lin,Pref,NNul,NVol,Bit) B1 02
  376. // Report ID (16) 85 10
  377. // Usage (Vendor-Defined 38) 09 26
  378. // Report Count (4) 95 04
  379. // Feature (Data,Var,Abs,NWrp,Lin,Pref,NNul,NVol,Bit) B1 02
  380. // Report ID (17) 85 11
  381. // Usage (Vendor-Defined 39) 09 27
  382. // Report Count (2) 95 02
  383. // Feature (Data,Var,Abs,NWrp,Lin,Pref,NNul,NVol,Bit) B1 02
  384. // Report ID (18) 85 12
  385. // Usage Page (Vendor-Defined 3) 06 02 FF
  386. // Usage (Vendor-Defined 33) 09 21
  387. // Report Count (15) 95 0F
  388. // Feature (Data,Var,Abs,NWrp,Lin,Pref,NNul,NVol,Bit) B1 02
  389. // Report ID (19) 85 13
  390. // Usage (Vendor-Defined 34) 09 22
  391. // Report Count (22) 95 16
  392. // Feature (Data,Var,Abs,NWrp,Lin,Pref,NNul,NVol,Bit) B1 02
  393. // Report ID (20) 85 14
  394. // Usage Page (Vendor-Defined 6) 06 05 FF
  395. // Usage (Vendor-Defined 32) 09 20
  396. // Report Count (16) 95 10
  397. // Feature (Data,Var,Abs,NWrp,Lin,Pref,NNul,NVol,Bit) B1 02
  398. // Report ID (21) 85 15
  399. // Usage (Vendor-Defined 33) 09 21
  400. // Report Count (44) 95 2C
  401. // Feature (Data,Var,Abs,NWrp,Lin,Pref,NNul,NVol,Bit) B1 02
  402. // Usage Page (Vendor-Defined 129) 06 80 FF
  403. // Report ID (128) 85 80
  404. // Usage (Vendor-Defined 32) 09 20
  405. // Report Count (6) 95 06
  406. // Feature (Data,Var,Abs,NWrp,Lin,Pref,NNul,NVol,Bit) B1 02
  407. // Report ID (129) 85 81
  408. // Usage (Vendor-Defined 33) 09 21
  409. // Report Count (6) 95 06
  410. // Feature (Data,Var,Abs,NWrp,Lin,Pref,NNul,NVol,Bit) B1 02
  411. // Report ID (130) 85 82
  412. // Usage (Vendor-Defined 34) 09 22
  413. // Report Count (5) 95 05
  414. // Feature (Data,Var,Abs,NWrp,Lin,Pref,NNul,NVol,Bit) B1 02
  415. // Report ID (131) 85 83
  416. // Usage (Vendor-Defined 35) 09 23
  417. // Report Count (1) 95 01
  418. // Feature (Data,Var,Abs,NWrp,Lin,Pref,NNul,NVol,Bit) B1 02
  419. // Report ID (132) 85 84
  420. // Usage (Vendor-Defined 36) 09 24
  421. // Report Count (4) 95 04
  422. // Feature (Data,Var,Abs,NWrp,Lin,Pref,NNul,NVol,Bit) B1 02
  423. // Report ID (133) 85 85
  424. // Usage (Vendor-Defined 37) 09 25
  425. // Report Count (6) 95 06
  426. // Feature (Data,Var,Abs,NWrp,Lin,Pref,NNul,NVol,Bit) B1 02
  427. // Report ID (134) 85 86
  428. // Usage (Vendor-Defined 38) 09 26
  429. // Report Count (6) 95 06
  430. // Feature (Data,Var,Abs,NWrp,Lin,Pref,NNul,NVol,Bit) B1 02
  431. // Report ID (135) 85 87
  432. // Usage (Vendor-Defined 39) 09 27
  433. // Report Count (35) 95 23
  434. // Feature (Data,Var,Abs,NWrp,Lin,Pref,NNul,NVol,Bit) B1 02
  435. // Report ID (136) 85 88
  436. // Usage (Vendor-Defined 40) 09 28
  437. // Report Count (34) 95 22
  438. // Feature (Data,Var,Abs,NWrp,Lin,Pref,NNul,NVol,Bit) B1 02
  439. // Report ID (137) 85 89
  440. // Usage (Vendor-Defined 41) 09 29
  441. // Report Count (2) 95 02
  442. // Feature (Data,Var,Abs,NWrp,Lin,Pref,NNul,NVol,Bit) B1 02
  443. // Report ID (144) 85 90
  444. // Usage (Vendor-Defined 48) 09 30
  445. // Report Count (5) 95 05
  446. // Feature (Data,Var,Abs,NWrp,Lin,Pref,NNul,NVol,Bit) B1 02
  447. // Report ID (145) 85 91
  448. // Usage (Vendor-Defined 49) 09 31
  449. // Report Count (3) 95 03
  450. // Feature (Data,Var,Abs,NWrp,Lin,Pref,NNul,NVol,Bit) B1 02
  451. // Report ID (146) 85 92
  452. // Usage (Vendor-Defined 50) 09 32
  453. // Report Count (3) 95 03
  454. // Feature (Data,Var,Abs,NWrp,Lin,Pref,NNul,NVol,Bit) B1 02
  455. // Report ID (147) 85 93
  456. // Usage (Vendor-Defined 51) 09 33
  457. // Report Count (12) 95 0C
  458. // Feature (Data,Var,Abs,NWrp,Lin,Pref,NNul,NVol,Bit) B1 02
  459. // Report ID (160) 85 A0
  460. // Usage (Vendor-Defined 64) 09 40
  461. // Report Count (6) 95 06
  462. // Feature (Data,Var,Abs,NWrp,Lin,Pref,NNul,NVol,Bit) B1 02
  463. // Report ID (161) 85 A1
  464. // Usage (Vendor-Defined 65) 09 41
  465. // Report Count (1) 95 01
  466. // Feature (Data,Var,Abs,NWrp,Lin,Pref,NNul,NVol,Bit) B1 02
  467. // Report ID (162) 85 A2
  468. // Usage (Vendor-Defined 66) 09 42
  469. // Report Count (1) 95 01
  470. // Feature (Data,Var,Abs,NWrp,Lin,Pref,NNul,NVol,Bit) B1 02
  471. // Report ID (163) 85 A3
  472. // Usage (Vendor-Defined 67) 09 43
  473. // Report Count (48) 95 30
  474. // Feature (Data,Var,Abs,NWrp,Lin,Pref,NNul,NVol,Bit) B1 02
  475. // Report ID (164) 85 A4
  476. // Usage (Vendor-Defined 68) 09 44
  477. // Report Count (13) 95 0D
  478. // Feature (Data,Var,Abs,NWrp,Lin,Pref,NNul,NVol,Bit) B1 02
  479. // Report ID (165) 85 A5
  480. // Usage (Vendor-Defined 69) 09 45
  481. // Report Count (21) 95 15
  482. // Feature (Data,Var,Abs,NWrp,Lin,Pref,NNul,NVol,Bit) B1 02
  483. // Report ID (166) 85 A6
  484. // Usage (Vendor-Defined 70) 09 46
  485. // Report Count (21) 95 15
  486. // Feature (Data,Var,Abs,NWrp,Lin,Pref,NNul,NVol,Bit) B1 02
  487. // Report ID (240) 85 F0
  488. // Usage (Vendor-Defined 71) 09 47
  489. // Report Count (63) 95 3F
  490. // Feature (Data,Var,Abs,NWrp,Lin,Pref,NNul,NVol,Bit) B1 02
  491. // Report ID (241) 85 F1
  492. // Usage (Vendor-Defined 72) 09 48
  493. // Report Count (63) 95 3F
  494. // Feature (Data,Var,Abs,NWrp,Lin,Pref,NNul,NVol,Bit) B1 02
  495. // Report ID (242) 85 F2
  496. // Usage (Vendor-Defined 73) 09 49
  497. // Report Count (15) 95 0F
  498. // Feature (Data,Var,Abs,NWrp,Lin,Pref,NNul,NVol,Bit) B1 02
  499. // Report ID (167) 85 A7
  500. // Usage (Vendor-Defined 74) 09 4A
  501. // Report Count (1) 95 01
  502. // Feature (Data,Var,Abs,NWrp,Lin,Pref,NNul,NVol,Bit) B1 02
  503. // Report ID (168) 85 A8
  504. // Usage (Vendor-Defined 75) 09 4B
  505. // Report Count (1) 95 01
  506. // Feature (Data,Var,Abs,NWrp,Lin,Pref,NNul,NVol,Bit) B1 02
  507. // Report ID (169) 85 A9
  508. // Usage (Vendor-Defined 76) 09 4C
  509. // Report Count (8) 95 08
  510. // Feature (Data,Var,Abs,NWrp,Lin,Pref,NNul,NVol,Bit) B1 02
  511. // Report ID (170) 85 AA
  512. // Usage (Vendor-Defined 78) 09 4E
  513. // Report Count (1) 95 01
  514. // Feature (Data,Var,Abs,NWrp,Lin,Pref,NNul,NVol,Bit) B1 02
  515. // Report ID (171) 85 AB
  516. // Usage (Vendor-Defined 79) 09 4F
  517. // Report Count (57) 95 39
  518. // Feature (Data,Var,Abs,NWrp,Lin,Pref,NNul,NVol,Bit) B1 02
  519. // Report ID (172) 85 AC
  520. // Usage (Vendor-Defined 80) 09 50
  521. // Report Count (57) 95 39
  522. // Feature (Data,Var,Abs,NWrp,Lin,Pref,NNul,NVol,Bit) B1 02
  523. // Report ID (173) 85 AD
  524. // Usage (Vendor-Defined 81) 09 51
  525. // Report Count (11) 95 0B
  526. // Feature (Data,Var,Abs,NWrp,Lin,Pref,NNul,NVol,Bit) B1 02
  527. // Report ID (174) 85 AE
  528. // Usage (Vendor-Defined 82) 09 52
  529. // Report Count (1) 95 01
  530. // Feature (Data,Var,Abs,NWrp,Lin,Pref,NNul,NVol,Bit) B1 02
  531. // Report ID (175) 85 AF
  532. // Usage (Vendor-Defined 83) 09 53
  533. // Report Count (2) 95 02
  534. // Feature (Data,Var,Abs,NWrp,Lin,Pref,NNul,NVol,Bit) B1 02
  535. // Report ID (176) 85 B0
  536. // Usage (Vendor-Defined 84) 09 54
  537. // Report Count (63) 95 3F
  538. // Feature (Data,Var,Abs,NWrp,Lin,Pref,NNul,NVol,Bit) B1 02
  539. // Report ID (177) 85 B1
  540. // Usage (Vendor-Defined 85) 09 55
  541. // Report Count (2) 95 02
  542. // Feature (Data,Var,Abs,NWrp,Lin,Pref,NNul,NVol,Bit) B1 02
  543. // Report ID (178) 85 B2
  544. // Usage (Vendor-Defined 86) 09 56
  545. // Report Count (2) 95 02
  546. // Feature (Data,Var,Abs,NWrp,Lin,Pref,NNul,NVol,Bit) B1 02
  547. // Report ID (224) 85 E0
  548. // Usage (Vendor-Defined 87) 09 57
  549. // Report Count (2) 95 02
  550. // Feature (Data,Var,Abs,NWrp,Lin,Pref,NNul,NVol,Bit) B1 02
  551. // Report ID (179) 85 B3
  552. // Usage (Vendor-Defined 85) 09 55
  553. // Report Count (63) 95 3F
  554. // Feature (Data,Var,Abs,NWrp,Lin,Pref,NNul,NVol,Bit) B1 02
  555. // Report ID (180) 85 B4
  556. // Usage (Vendor-Defined 85) 09 55
  557. // Report Count (63) 95 3F
  558. // Feature (Data,Var,Abs,NWrp,Lin,Pref,NNul,NVol,Bit) B1 02
  559. // End Collection C0
  560. #endif // UNITY_EDITOR || UNITY_STANDALONE_OSX || UNITY_STANDALONE_WIN || UNITY_WSA