sorry about the bump, but I'm running into some issues with controllers here and this seemed like the best topic to address it : )
I've recently been working on a project with SFML, and converted over from SFML to SFML 2 due to the lack of Controller/Joystick support for 1.6.
Having finally gotten everything updated to work with SFML 2, I discovered that my Xbox 360 controller (with HID driver from tattiebogle (google it)) refused to work on my mac. My Gamecube to USB adapter, supporting HID out of the box on Mac OS X, works just fine.
The 360 joystick works fine in any piece of software, such as emulators. SDL even, but not in SFML 2.
Also, I tried removing the driver as you mentioned your PS3 controller worked without one, but that definetely stops it from functioning in the other software, and doesn't change the fact that SFML 2 just isn't picking it up.
I have no clue what's going on and being able to use the 360 controller would be really nice seeing as I bought the thing specifically for use with my project..
It might be the driver, though, but I just don't know.
I've fired up IORegistryExplorer and it shows the following info about the controllers [
link ]
Would it be possible to sort out this issue?
PS. I was using sf::Joystick::IsConnected to test for joypads
Edit:
I can confirm that the PS3 controller is indeed picked up as a HID device out of the box on Mac OS X Lion, but I know for sure that it wasn't on Snow Leopard because it, too required special drivers to function on that OS. Apple must have added support for it :O
Edit2:
Actually, I've been digging through the source of SFML2, IOKit documentation, and whatnot, and I noticed the following:
in SFML/Window/OSX/HIDJoystickManager.cpp:
Line 78:
CFDictionaryRef mask = HIDInputManager::CopyDevicesMask(kHIDPage_GenericDesktop, kHIDUsage_GD_Joystick);
Looks to me like HID devices are filtered in the constructor of HIDJoystickManager, by kHIDUsage_GD_Joystick
I found in the SDL implementation of OSX Joysticks that they actually filter on kHIDUsage_GD_Joystick and kHIDUsage_GD_Gamepad
Now, using Apple's HID_Dumper example project, I printed a dump of info about my HID Devices.
Device: 0x332340 = { ©Microsoft Corporation - Controller, vendorID: 0x045E, productID: 0x028E, usage: 0x0001:0x0005, "Generic Desktop GamePad", Transport: "USB", SerialNumber: "05B528B", locationID: 0xFD130000, MaxInputReportSize: 14, ReportInterval: 8000, }
Device: 0x332fb0 = { Sony - PLAYSTATION(R)3 Controller, vendorID: 0x054C, productID: 0x0268, usage: 0x0001:0x0004, "Generic Desktop Joystick", Transport: "Bluetooth", VendorIDSource: 2, version: 256, SerialNumber: "00-1b-fb-a3-90-f9", CountryCode: 33, locationID: 0x7BA390F9, MaxInputReportSize: 49, MaxOutputReportSize: 49, MaxFeatureReportSize: 49, ReportInterval: 11250, }
Device: 0x332ad0 = { WiseGroup.,Ltd - GameCube to USB box 1, vendorID: 0x0926, productID: 0x8888, usage: 0x0001:0x0004, "Generic Desktop Joystick", Transport: "USB", version: 648, locationID: 0xFA120000, MaxInputReportSize: 8, MaxOutputReportSize: 7, ReportInterval: 8000, }
You'll notice that the 360 controller shows up as a Gamepad, and it doesn't work with SFML. the PS3 and GC adapters show up as Joysticks, and they DO work.
In other words, I don't know how to include Gamepads in the HID devices filtering code (I tried, but it didn't produce anything functional), but simply adding them may very well resolve this issue. (which would make me eternally grateful)