Nessuna descrizione
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.

OSXSupport.cs 1.1KB

1234567891011121314151617181920212223242526272829303132
  1. #if UNITY_EDITOR || UNITY_STANDALONE_OSX
  2. using UnityEngine.InputSystem.Layouts;
  3. using UnityEngine.InputSystem.OSX.LowLevel;
  4. namespace UnityEngine.InputSystem.OSX
  5. {
  6. /// <summary>
  7. /// A small helper class to aid in initializing and registering HID device layout builders.
  8. /// </summary>
  9. #if UNITY_DISABLE_DEFAULT_INPUT_PLUGIN_INITIALIZATION
  10. public
  11. #else
  12. internal
  13. #endif
  14. static class OSXSupport
  15. {
  16. /// <summary>
  17. /// Registers HID device layouts for OSX.
  18. /// </summary>
  19. public static void Initialize()
  20. {
  21. // Note that OSX reports manufacturer "Unknown" and a bogus VID/PID according
  22. // to matcher below.
  23. InputSystem.RegisterLayout<NimbusGamepadHid>(
  24. matches: new InputDeviceMatcher()
  25. .WithProduct("Nimbus+", supportRegex: false)
  26. .WithCapability("vendorId", NimbusPlusHIDInputReport.OSXVendorId)
  27. .WithCapability("productId", NimbusPlusHIDInputReport.OSXProductId));
  28. }
  29. }
  30. }
  31. #endif // UNITY_EDITOR || UNITY_STANDALONE_OSX