Exemplo n.º 1
0
Arquivo: SCXI.cs Projeto: MrPnut/SCXI
 private Scxi(IHidDevice device, XboxControllerAdapter controllerAdapter, AppConfig config)
 {
     _device            = device;
     _controllerAdapter = controllerAdapter;
     _featureEnforcer   = new FeatureEnforcer(device);
     _mapper            = new ControllerStateMapper(config.Input);
 }
Exemplo n.º 2
0
Arquivo: SCXI.cs Projeto: MrPnut/SCXI
        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));
        }