gerardorosiles / slimdx

Automatically exported from code.google.com/p/slimdx
MIT License
0 stars 0 forks source link

Xinput.zip Controller sample from 413/435 #891

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Was attempting to use the sample as a pointer for how to use the Controller 
class correctly and noticed that Controllers #2, #3, and #4 were duplicating 
the results on the labels.

Offending code is ControllerForm.cs in UpdateControllerState, just need to drop 
the stateString variable down into the for loop.  

I understand if this is an insta-close as it is in regards to a sample, but I 
thought I was going crazy at first when it said all the controllers were 
connected and registering the same key-presses.

Thank you for this excellent api!

//Original Code:
        private void UpdateControllerState()
        {
            String stateText = " Not Connected";
            Vibration vibration = new Vibration();

            for (int i = 0; i < MaxControllers; i++)
            {
                if (Controllers[i].IsConnected)

//Fixed Code:
        private void UpdateControllerState()
        {
            Vibration vibration = new Vibration(); 

            for (int i = 0; i < MaxControllers; i++)
            {
                String stateText = " Not Connected";

                if (Controllers[i].IsConnected)

Original issue reported on code.google.com by Christop...@gmail.com on 17 Jan 2013 at 4:58

GoogleCodeExporter commented 9 years ago
I think the sample you're referring to is very old, and isn't in the source 
depo so it's not something I can update. It seems like you have things in hand 
though.

Original comment by Mike.Popoloski on 24 Jan 2013 at 4:39