Maze / Library /PackageCache /com.unity.inputsystem@1.6.1 /InputSystem /Plugins /XInput /XInputSupport.cs
| ////TODO: add support for Windows.Gaming.Input.Gamepad (including the trigger motors) | |
| using UnityEngine.InputSystem.Layouts; | |
| namespace UnityEngine.InputSystem.XInput | |
| { | |
| /// <summary> | |
| /// Adds support for XInput controllers. | |
| /// </summary> | |
| public | |
| internal | |
| static class XInputSupport | |
| { | |
| public static void Initialize() | |
| { | |
| // Base layout for Xbox-style gamepad. | |
| InputSystem.RegisterLayout<XInputController>(); | |
| ////FIXME: layouts should always be available in the editor (mac/win/linux) | |
| InputSystem.RegisterLayout<XInputControllerWindows>( | |
| matches: new InputDeviceMatcher().WithInterface("XInput")); | |
| InputSystem.RegisterLayout<XboxGamepadMacOS>( | |
| matches: new InputDeviceMatcher().WithInterface("HID") | |
| .WithProduct("Xbox.*Wired Controller")); | |
| InputSystem.RegisterLayout<XboxOneGampadMacOSWireless>( | |
| matches: new InputDeviceMatcher().WithInterface("HID") | |
| .WithProduct("Xbox.*Wireless Controller")); | |
| } | |
| } | |
| } | |