I have a member thread for an object running that also contains a RawGameController.
The thread is in a while loop and should constantly update check the controller, but when I check the values nothing changes. I can confirm the controller is there in windows and the buttons work. (it's xbox 360 wired, but it needs to support many different controllers, so I can't use Gamepad object.)
public class myController
{
public RawGameController rgController;
public Thread Poller;
public void ControllerPoller()
{
bool[] buttonArray = new bool[rgController.ButtonCount];
GameControllerSwitchPosition[] switchArray = new GameControllerSwitchPosition[rgController.SwitchCount];
double[] axisArray = new double[rgController.AxisCount];
bool[] oldButtonArray = new bool[rgController.ButtonCount];
GameControllerSwitchPosition[] oldSwitchArray = new GameControllerSwitchPosition[rgController.SwitchCount];
double[] oldAxisArray = new double[rgController.AxisCount];
while (true)
{
//roughly polling 60hz so...
using (var waitHandle = new ManualResetEventSlim(initialState: false))
{
waitHandle.Wait(TimeSpan.FromMilliseconds(1000 / 60));
}
rgController.GetCurrentReading(buttonArray, switchArray, axisArray);
if (buttonArray.Equals(oldButtonArray) && switchArray.Equals(oldSwitchArray) && axisArray.Equals(oldAxisArray))
{
continue;
}
I then deal with the input changes further on.
Any help would be great.