Details on Controller Support in Mac Simulator

Hi CL Team:

I’m intrigued by the notes in the last few daily builds that mention controller support for the Mac simulator. Can we get any details on how to best implement this? Do we need to do anything on the OS X side of things, other than plug in a USB controller? Is wireless/bluetooth supported? Any details you can give would be most welcome - and this might make for a cool blog post, depending on how deep support goes. Really looking forward to being able to test analog stick input in the simulator!

Thanks,

Jason

There’s a new sample code project that you can look at: https://github.com/coronalabs/samples-coronasdk/blob/master/Hardware/InputDevices/main.lua#L286-L326

You can find it in the most recent simulator builds under Hardware/InputDevices. You’ll also find that keyboard input has improved on OSX recently, making it a bit more game-friendly.

We’ll have a new, fancier sample code in the next week or so.

Hey, Jason! Glad you’re interested.

If your controller work with other games, it should work with OS X in latest daily build. Both bluetooth and usb controllers are supported. I tested 2015.2666 with Xbox 360/One (you would need drivers here, because Microsoft). Other controllers worked without drivers, like DualShock 4 (PS4) via bluetooth and cable, as well as PS3 and PS1 (with adapter), various logitech and no-name gamepads. As Michael wrote, Stay tuned for more information and nice sample. But all functionality is already in, as well as daily builds docs have documentation. It changed very little comparing to Android controller support.

To conclude - you can test analog stick in simulator right now. Use “axis” event. We already had a guide on how to implement gamepad support in our blog posts. May be we’ll revamp some of those or just make some nicely documented extensive sample.

Have fun!

Thanks for the fast reply, guys! I’d been using a keymapping app to “fake” digital controller support on OS X, but that wouldn’t work for analog input. I’m totally psyched to have more “native” type support. Will be test-driving it this week for sure!

Let us know how it goes. We’ve been doing some internal testing ourselves:
 

There’s a new sample code project that you can look at: https://github.com/coronalabs/samples-coronasdk/blob/master/Hardware/InputDevices/main.lua#L286-L326

You can find it in the most recent simulator builds under Hardware/InputDevices. You’ll also find that keyboard input has improved on OSX recently, making it a bit more game-friendly.

We’ll have a new, fancier sample code in the next week or so.

Hey, Jason! Glad you’re interested.

If your controller work with other games, it should work with OS X in latest daily build. Both bluetooth and usb controllers are supported. I tested 2015.2666 with Xbox 360/One (you would need drivers here, because Microsoft). Other controllers worked without drivers, like DualShock 4 (PS4) via bluetooth and cable, as well as PS3 and PS1 (with adapter), various logitech and no-name gamepads. As Michael wrote, Stay tuned for more information and nice sample. But all functionality is already in, as well as daily builds docs have documentation. It changed very little comparing to Android controller support.

To conclude - you can test analog stick in simulator right now. Use “axis” event. We already had a guide on how to implement gamepad support in our blog posts. May be we’ll revamp some of those or just make some nicely documented extensive sample.

Have fun!

Thanks for the fast reply, guys! I’d been using a keymapping app to “fake” digital controller support on OS X, but that wouldn’t work for analog input. I’m totally psyched to have more “native” type support. Will be test-driving it this week for sure!

Let us know how it goes. We’ve been doing some internal testing ourselves: