SFML community forums

Help => System => Topic started by: AshleyF on August 04, 2015, 05:30:04 pm

Title: SFML 2.3.1 not detecting Xbox 360 Controller under Mac Yosemite
Post by: AshleyF on August 04, 2015, 05:30:04 pm
Dear All,

My Xbox 360 controller is not detected under Yosemite 10.10.4! When I plug the controller into my iMac, the lights for 1 - 4 light up very briefly, but then they all switch off. I know the controller works as I've tested it on my PC.

In attempting to diagnose possible coding problems, the errors are as follows: 1) It doesn't detect it at all; and 2) If you do a cout regarding how many buttons there are, it always reports 32.

Code for joystick detection is as follows:

#include <SFML/Audio.hpp>
#include <SFML/Graphics.hpp>
#include "ResourcePath.hpp"
#include <iostream>

int main(int, char const**)
{
    sf::RenderWindow window(sf::VideoMode(800, 600), "SFML window");

    while (window.isOpen())
    {
        sf::Event event;
        while (window.pollEvent(event))
        {
            if (event.type == sf::Event::Closed) {
                window.close();
            }

            if (event.type == sf::Event::KeyPressed && event.key.code == sf::Keyboard::Escape) {
                window.close();
            }
        }

        window.clear();

        if (sf::Joystick::isConnected(0))
            std::cout << "Joystick is connected" << std::endl;

        window.display();
    }

    return EXIT_SUCCESS;
}

If anyone can enlighten me as to the solution, I'd be most grateful!

Kind regards,

AshleyF
Title: Re: SFML 2.3.1 not detecting Xbox 360 Controller under Mac Yosemite
Post by: Laurent on August 04, 2015, 05:47:00 pm
Quote
When I plug the controller into my iMac, the lights for 1 - 4 light up very briefly, but then they all switch off
So you mean that they are supposed to stay on? In this case, it's rather a driver issue with your Mac. Make sure that it works on the Mac before trying to use it with SFML.
Title: Re: SFML 2.3.1 not detecting Xbox 360 Controller under Mac Yosemite
Post by: AshleyF on August 04, 2015, 09:17:36 pm
Dear Laurent,

Thank you very much for your reply. After using Google, I have discovered one possible driver for the Xbox controller. It is located at:

http://www.macupdate.com/app/mac/24762/xbox-360-controller-driver

Before I install this, could you please check with Marco if it's what he'd advise!

Kind regards,

AshleyF
Title: Re: SFML 2.3.1 not detecting Xbox 360 Controller under Mac Yosemite
Post by: Hiura on August 04, 2015, 09:27:17 pm
I would not recommend any software from that kind of website, you never know what you actually download and there's no proper link to the origin of the software.

One comment is especially funny: someone wrote 'how do i download it' and put 5/5 stars... ::)

However, this one is more interesting:

Quote from:  mele113
Is Not compatible with Yosemite OSX so don't bother wasting time on this one ...no support nor info in regards to Mountain Lion, Mavericks or Yosemite.....compatibility

There's also this link in the comment: https://github.com/d235j/360Controller/ but it seems rather dead (or maybe not?) so... at your own risks.



I don't own a Xbox controller but with the PS3 one, there's a trick to make it work properly: first connect it with USB then activate the bluetooth connection and finally unplug it. No special driver involved. Maybe something similar will work for you?
Title: Re: SFML 2.3.1 not detecting Xbox 360 Controller under Mac Yosemite
Post by: Nexus on August 04, 2015, 09:33:03 pm
In general, I would download drivers only from the official manufacturer's website. You cannot verify whether third-party sites are trustworthy, and you can easily install malware or spyware without ever noticing (no, anti-virus software won't necessarily protect you). Thus it's really a risk you should not carelessly take.
Title: Re: SFML 2.3.1 not detecting Xbox 360 Controller under Mac Yosemite
Post by: AshleyF on August 04, 2015, 09:36:16 pm
Dear Hiura,

Thank you very much for your kind reply.

I've just ordered a PC/Mac compatible joystick that doesn't need drivers. Hopefully that'll solve the problem!

Kind regards,

AshleyF