private void DisableHidGuardian() { HidGuardian.RemoveDeviceFromAffectedList(XiaomiGamepadHardwareId); HidGuardian.RemoveFromWhitelist(Process.GetCurrentProcess().Id); // Disable and reenable the device to let the driver hide the emulated gamepad and show the HID one again DeviceStateManager.DisableReEnableDevice(XiaomiGamepadHardwareId); }
private void EnableHidGuardian() { // Temp HidGuardian.ClearWhitelistedProcesses(); HidGuardian.ClearAffectedDevices(); HidGuardian.AddDeviceToAffectedList(XiaomiGamepadHardwareId); HidGuardian.AddToWhitelist(Process.GetCurrentProcess().Id); // Disable and reenable the device to let the driver hide the HID gamepad and show Xbox360 one DeviceStateManager.DisableReEnableDevice(XiaomiGamepadHardwareId); }