LastChangedAfter() публичный Метод

public LastChangedAfter ( InputDevice otherDevice ) : bool
otherDevice InputDevice
Результат bool
Пример #1
0
        private static void UpdateActiveDevice()
        {
            InputDevice inputDevice = ActiveDevice;
            int         count       = devices.Count;

            for (int i = 0; i < count; i++)
            {
                InputDevice inputDevice2 = devices[i];
                if (inputDevice2.LastChangedAfter(ActiveDevice) && !inputDevice2.Passive)
                {
                    ActiveDevice = inputDevice2;
                }
            }
            if (inputDevice != ActiveDevice && InputManager.OnActiveDeviceChanged != null)
            {
                InputManager.OnActiveDeviceChanged(ActiveDevice);
            }
        }
Пример #2
0
        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);
        }