using-game-controller
Overview
A comprehensive guide to Apple's GameController framework - covering Swift/ObjC APIs, platform considerations, and porting from Windows.
Use the GameController framework when writing code for Apple platforms that interacts with game controllers. The GCController API presents a common abstraction over gamepad and joystick input devices. The GameController framework supports popular game controllers including the Sony DualSHOCK 4, Sony DualSense, Nintendo Switch Pro, and Microsoft Xbox controllers. Advanced features available on these controllers - IMU, Rumble, and Adaptive Triggers (force feedback) - are supported.
When porting Windows code that calls RawInput (e.g, RegisterRawInputDevices) or HID (HidP_*) APIs to interfce with Sony, Nintendo, and other non-Xbox controllers, AVOID writing equivalent code that uses IOKit and IOHIDManager APIs. PREFER to re-write the code to use the abstractions provided by the GCController API instead.