示例#1
0
        JoystickState IJoystickDriver2.GetState(int index)
        {
            LinuxJoystickDetails js = Sticks.FromIndex(index);

            if (js != null)
            {
                PollJoystick(js);
                return(js.State);
            }
            return(new JoystickState());
        }
        KeyboardState IKeyboardDriver2.GetState(int index)
        {
            lock (Sync)
            {
                var device = Keyboards.FromIndex(index);
                if (device != null)
                {
                    return(device.State);
                }

                return(new KeyboardState());
            }
        }
        MouseState IMouseDriver2.GetState(int index)
        {
            lock (Sync)
            {
                var device = Mice.FromIndex(index);
                if (device != null)
                {
                    return(device.State);
                }

                return(new MouseState());
            }
        }
示例#4
0
 bool IsValid(int index)
 {
     return(Devices.FromIndex(index) != null);
 }