InputDevice FindActiveDevice() { var hasIncludeDevices = IncludeDevices.Count > 0; var hasExcludeDevices = ExcludeDevices.Count > 0; if (hasIncludeDevices || hasExcludeDevices) { var foundDevice = InputDevice.Null; var deviceCount = InputManager.Devices.Count; for (var i = 0; i < deviceCount; i++) { var device = InputManager.Devices[i]; if (device != foundDevice && device.LastChangedAfter(foundDevice)) { if (hasExcludeDevices && ExcludeDevices.Contains(device)) { continue; } if (!hasIncludeDevices || IncludeDevices.Contains(device)) { foundDevice = device; } } } return(foundDevice); } return(InputManager.ActiveDevice); }
private InputDevice FindActiveDevice() { bool flag = IncludeDevices.Count > 0; bool flag2 = ExcludeDevices.Count > 0; if (flag || flag2) { InputDevice inputDevice = InputDevice.Null; int count = InputManager.Devices.Count; for (int i = 0; i < count; i++) { InputDevice inputDevice2 = InputManager.Devices[i]; if (inputDevice2 != inputDevice && inputDevice2.LastChangedAfter(inputDevice) && (!flag2 || !ExcludeDevices.Contains(inputDevice2)) && (!flag || IncludeDevices.Contains(inputDevice2))) { inputDevice = inputDevice2; } } return(inputDevice); } return(InputManager.ActiveDevice); }