コード例 #1
0
ファイル: Mi360Application.cs プロジェクト: kingzengg/mi-360
        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);
        }
コード例 #2
0
ファイル: Mi360Application.cs プロジェクト: kingzengg/mi-360
        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);
        }