public void ReloadConfiguration(List <InputConfig> inputConfig, bool enableKeyboard) { lock (_lock) { for (int i = 0; i < _controllers.Length; i++) { _controllers[i]?.Dispose(); _controllers[i] = null; } foreach (InputConfig inputConfigEntry in inputConfig) { NpadController controller = new NpadController(_cemuHookClient); bool isValid = DriverConfigurationUpdate(ref controller, inputConfigEntry); if (!isValid) { controller.Dispose(); } else { _controllers[(int)inputConfigEntry.PlayerIndex] = controller; } } _inputConfig = inputConfig; _enableKeyboard = enableKeyboard; _device.Hid.RefreshInputConfig(inputConfig); } }
public void ReloadConfiguration(List <InputConfig> inputConfig) { lock (_lock) { for (int i = 0; i < _controllers.Length; i++) { _controllers[i]?.Dispose(); _controllers[i] = null; } foreach (InputConfig inputConfigEntry in inputConfig) { NpadController controller = new NpadController(_cemuHookClient); bool isValid = DriverConfigurationUpdate(ref controller, inputConfigEntry); if (!isValid) { controller.Dispose(); } else { _controllers[(int)inputConfigEntry.PlayerIndex] = controller; } } _inputConfig = inputConfig; // Enforce an update of the property that will be updated by HLE. // TODO: Move that in the input manager maybe? ConfigurationState.Instance.Hid.InputConfig.Value = inputConfig; } }