Workaround for wrong HID usage descriptor sent by Bluetooth Gamepad

bluetoothinput-sourcekeyboard

I am investigating an incompatibility of some Bluetooth Gamepads with OSX:
I have a Bluetooth Gamepad (NES30 Pro). The problem is that if I connect it over bluetooth, it does not work properly under OSX. I already have found the cause and have informed the manufacturer, and they promised to look into fixing that. However meanwhile I would like to find a workaround.

The cause of the problem is that the Gamepad does not send a proper HID usage descriptor when it is connected via Bluetooth. The Gamepad should send a HID usage descriptor that signals that it is a gamepad. However it sends a HID usage descriptor that signals that it is a compound device of Keyboard, Mouse and Gamepad at the same time.

For illustration, this is a screenshot of the Windows device manager, showing that the Gamepad acts as several device types at once.
For illustration, this is a screenshot taken on Windows , showing that the device acts as several device types at once

Windows and Linux simply create 3 devices, one keyboard device, one mouse device and one gamepad device. However OSX creates just one device which contains all the functionality at once, which most programmes fail to recognize as a Gamepad. So far the only App that could show me that position data of the Analog axes and of the gamepad buttons is indeed transmitted is the HID explorer app by apple (http://developer.apple.com/mac/library/samplecode/HID_Explorer/HID_Explorer.zip)

Now I am looking for a workaround on OSX. Some Linux systems have a problem as well with the wron HID usage descriptor. However they usually can fix it by setting a udev rule that specifically tells the system to treat the device as gamepad/joystick, for example like that:

# 8Bitdo SFC30 GamePad Bluetooth mode(START)
SUBSYSTEM=="input", ATTRS{name}=="8Bitdo SFC30 GamePad", MODE="0666", ENV{ID_INPUT_JOYSTICK}="1"

Of course OSX does not have udev. Does anybody know how to tell/force OSX to treat an input device as a joystick/gamepad? Or maybe how to create a virtual gamepad device which takes its input from the axes/buttons of the keyboard/mouse/gamepad compound device? Or any other ideas how to tackle that problem?

Note: I am especially interested in using the analog sticks. So just mapping them to keyboard buttons is not an option. (The gamepad already has a special mode to do that on its own. However then the analog sticks of course do not work.)

Best Answer

I'd look at either getting some software to reproduce what the windows drivers do or look at hardware that has drivers for OS X.

Also, on OS X, the games you are looking to use need to also support looking for wireless controllers, so that might be an issue for you as well that needs to be overcome.