////TODO: add support for Windows.Gaming.Input.Gamepad (including the trigger motors) using UnityEngine.InputSystem.Layouts; namespace UnityEngine.InputSystem.XInput { /// /// Adds support for XInput controllers. /// #if UNITY_DISABLE_DEFAULT_INPUT_PLUGIN_INITIALIZATION public #else internal #endif static class XInputSupport { public static void Initialize() { // Base layout for Xbox-style gamepad. InputSystem.RegisterLayout(); ////FIXME: layouts should always be available in the editor (mac/win/linux) #if UNITY_STANDALONE_WIN || UNITY_EDITOR_WIN || UNITY_WSA InputSystem.RegisterLayout( matches: new InputDeviceMatcher().WithInterface("XInput")); #endif #if UNITY_STANDALONE_OSX || UNITY_EDITOR_OSX InputSystem.RegisterLayout( matches: new InputDeviceMatcher().WithInterface("HID") .WithProduct("Xbox.*Wired Controller")); InputSystem.RegisterLayout( matches: new InputDeviceMatcher().WithInterface("HID") .WithProduct("Xbox.*Wireless Controller")); #endif } } }