DualShock Controller button names PC vs. Mac/iOS

So I’ve noticed that DualShock controllers on PC and PC Sim return buttons as…

event.keyName = "button1..14"

…but when I pair a DualShock with an iPad or Mac the buttons are re-mapped to xBox style, e.g.

event.keyName = "buttonA"

Is that part of Apple’s MFi platform to conform buttons from other devices to the xBox style or is that something that Solar2D is doing?

My goal was to detect what kind of controller you had based on the button types, but if they all get mapped the same way, that’s tough. Also…

event.device.displayName or event.device.productName

…says something like “Wireless Controller” or “Joystick” which is not a big help.

If this video is to be believed, this is probably the case…

. . . and the DualShock button names go

X
Y A
B
and the xBox goes
Y
X B
A

The xBox layout seems more intuitive so I’ve been inverting the DualShock buttons

Also, on iOS and Mac, I’ve found that restarting my app with the controllers already established leads to less generic gamepad information. If I add the device while the app is already running I get more generic returns than if the device was already active before I started the app.

Interesting! Thanks for the info.