public static JoystickBase getJoyStickByName(string name) { if (pid == PlatformID.Unix) { return(JoystickLinux.getJoyStickByName(name)); } else { return(JoystickWindows.getJoyStickByName(name)); } }
public static IList <string> getDevices() { if (pid == PlatformID.Unix) { return(JoystickLinux.getDevices()); } else { return(JoystickWindows.getDevices().Select(a => a.ProductName.TrimUnPrintable()).ToList()); } }
public static JoystickBase getJoyStickByName(string name) { var joysticklist = getDevices(); foreach (var device in joysticklist) { if (device.ProductName.TrimUnPrintable() == name) { var js = new JoystickWindows(() => null); js.AcquireJoystick(name); return(js); } } return(null); }