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.


Messages - Vandenmills

Pages: [1]
1
Window / Re: Multiple joysticks - Joystick IDs
« on: May 21, 2013, 01:05:49 am »
If only it was that simple. We're going to use xbox 360 controllers, but we're modifying it, creating a different controller which will only have 3 buttons.

That said, the solution wasn't as easy as I wrote here. I ended up having to use Microsofts input library for the xbox controller. It's fine though, SFML works like a charm for the rest of the setup.

2
Window / Re: Multiple joysticks - Joystick IDs
« on: May 05, 2013, 12:56:11 pm »
Alright, thanks for taking the time to look into it :)

Found a solution by just switching the ID sent to the sf::Joystick::isPressed(). If the ID was 2 an if sentence made it into 1 and vice versa. It wasn't pretty but it worked.
(If someone has a better suggestion I'm all ears, I'm a newbie programmer and have programmed for less than a year).

Just thought I'd write the "solution" in case others run into the same type of problem.

3
Window / Re: Multiple joysticks - Joystick IDs
« on: May 05, 2013, 09:42:57 am »
Thanks OniLinkPlus for clarifying, that is exactly right :)

4
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