private Scxi(IHidDevice device, XboxControllerAdapter controllerAdapter, AppConfig config) { _device = device; _controllerAdapter = controllerAdapter; _featureEnforcer = new FeatureEnforcer(device); _mapper = new ControllerStateMapper(config.Input); }
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)); }