Xbox 360 & One USB Controller Interface for OS X (WIP)

In my excitement for Unity 5 I just put together a lightweight OS X executable that reads Xbox controllers.

The (very hairy) IOKit code is from the Chomium project’s HTML5 game controller, and I added a UDP layer to communicate controller state to Unity scripts.

https://github.com/troydawson/xboxshim

The shim could be converted to a .dylib plugin without too much work I guess if that is preferred.

I’ve attached the C# object script that reads the controller data over UDP. Note that you’ll have to change the script and relocate the xboxshim executable somewhere other than /Users/troy unless that is your home directory.

2010022–129861–TestScript.cs (3.42 KB)

I’ve added a Unity Plugins target (xboxcontroller.bundle), so you don’t have to do all the UDP stuff:

https://github.com/troydawson/xboxshim

The simpler scripting side is attached.

2011489–129961–TestScript.cs (2.45 KB)