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()); } }
bool IsValid(int index) { return(Devices.FromIndex(index) != null); }