Exemple #1
0
 private Scxi(IHidDevice device, XboxControllerAdapter controllerAdapter, AppConfig config)
 {
     _device            = device;
     _controllerAdapter = controllerAdapter;
     _featureEnforcer   = new FeatureEnforcer(device);
     _mapper            = new ControllerStateMapper(config.Input);
 }
Exemple #2
0
        internal static async Task <Scxi> Create(AppConfig config)
        {
            var hidFactory = new FilterDeviceDefinition(vendorId: 10462, productId: 4418, label: "Steam Controller")
                             .CreateWindowsHidDeviceFactory();

            var deviceDefinitions =
                await hidFactory.GetConnectedDeviceDefinitionsAsync();

            var device = await hidFactory.GetDeviceAsync(deviceDefinitions.Single(d => d.DeviceId.Contains("mi_01")));

            await device.InitializeAsync();

            return(new Scxi((IHidDevice)device, XboxControllerAdapter.Create(), config));
        }