public static Joypad TryConnect() { var pad = new Joypad(); pad.controller = new Controller(UserIndex.One); if (pad.controller.IsConnected) { return(pad); } return(null); }
private void PollForDevices() { while (controller == null || !controller.IsConnected()) { controller = Joypad.TryConnect(); if (controller == null) { Thread.Sleep(500); } } PollForInput(); }