Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - Vandenmills

Pages: [1]
1
Window / Multiple joysticks - Joystick IDs
« on: May 05, 2013, 12:36:01 am »
Hi,

I have a small question regarding joysticks. As part of a school project we're making a game where we are using 4 xbox 360 joysticks (as of writing I only have access to 3 controllers though). Windows identifies the joystick with the right ID. SFML however doesn't.

I've made a for loop that looks like this:
for (unsigned int i = 0; i < 4; i++)
{
        if (sf::Joystick::isConnected(i))
        {
                std::cout << "Joystick " << i << " connected!" << std::endl;
        }
}

My current setup is that I have 3 controllers, 2 wireless (1 receiver) and 1 wired. If i unplug the wired controller and have only 1 wireless connected it says that Joystick 2 is connected.
If I connect the second wireless controller, it says that Joystick 1 and joystick 2 is connected.
If I plug in the wired controller it says that I have joystick 0, 1 and 2 connected. The wired controller also gets the first ID. Regardless how I do it, this is how it ends up.

When using Xinput to control rumble it rumbles on the wrong controller, because Xinput seems to follow the lights on the controller and not the ID sfml gives them.

My question is this, is there a way to get SFML to use the xbox controller lights the same way Xinput does?

I'm using SFML 2.0 & Visual studio 2010 (32bit).

Pages: [1]
anything