Gamepads:Notes

From MozillaWiki
Jump to: navigation, search

Notes on using various controllers on various platforms

Generic USB HID controllers

Seem to work fine on all platforms, but button/axis mapping might be different. Tested with an old Nyko Airflo dual-analog gamepad. Works fine on Windows/Mac/Linux, but the d-pad is reported differently per-platform (Extra axes on Linux, buttons on Mac, POV hat on Windows).

Xbox 360 Controller

I have only tested a wireless controller using the Wireless Gaming Receiver. I have heard that the wired controllers work fine, however. As with generic USB HID controllers, some features are mapped differently on different OSes. It supports rumble, and that's exposed via XInput, but I haven't looked into using it at all.

The 360 controller supports plugging in a headset for audio in/out. I haven't looked into supporting that yet, might make a nice future addition, tied into the WebRTC APIs.

Windows

Wired controllers should work out of the box. The wireless receiver requires a driver install, but then works fine. Lots of the device features don't work without using XInput, so we'll need to add XInput support (bug 690937).

Linux

Both wired and wireless controllers work out of the box on recent kernels. (Tested on Ubuntu 10.04.) Not sure how to use rumble, might need to use the hidraw interface directly.

Mac

Both wired and wireless controllers require a driver to be installed. With the driver installed they work fine. The d-pad isn't currently exposed in our Mac gamepad backend, need to add support for that. (I believe it reports as a POV hat.)

Playstation 3 Controller (SIXAXIS/DualShock 3)

The DualShock 3 supports both USB and Bluetooth connectivity. It doesn't support normal Bluetooth pairing, you have to connect the device via USB first to pair, and then Bluetooth should work.

An interesting feature of this controller is that almost all of the buttons on it are pressure sensitive, so they can report a pressure value as well as simple press/release.

It also has accelerometers inside, which I have not yet looked into. It also supports rumble, but I haven't looked into that either.

Windows

Requires a driver install. Works fine once the driver is installed. (I've only tested it over USB, my Windows desktop doesn't have Bluetooth.) The driver offers multiple configurations, which might be a bit goofy. If you select "PS3 Controller" it offers the accelerometer data in some of the axes. You can custom configure button mappings, and it offers the analog button data in that view, but DirectInput doesn't seem to have enough places to put all of the data. Rumble is supported, presumably through the standard DI force feedback APIs.

Linux

Works out of the box on recent kernels (tested with Ubuntu 10.04). Reports all of the analog button pressures as separate axes(?!). We will almost definitely have to special-case that, the list of axes is known. The accelerometer data is available via hidraw, but I haven't tested that yet. I also haven't tested via Bluetooth, since my Linux desktop doesn't have BT, but it supposedly works.

Mac

Requires a driver install. Worked fine in both USB and Bluetooth modes on my Mac, but we don't have the analog button pressure data, AFAICT. Also, in Bluetooth mode we detect some ridiculous amount of buttons on the device.

Wiimote

The Wiimote is a bluetooth device. I haven't tried one yet, since mine are packed away somewhere, but I know people have been hooking them up to computers for a long time, so I suspect we can use them without a lot of fuss. I'll dig mine out eventually, but if someone else wants to test and report back I'd be interested to hear what happens.