PyObjC is a bridge between Python and Apple's Objective-C frameworks on macOS. The `pyobjc-framework-gamecontroller` package provides Python wrappers for the GameController framework, enabling Python applications to interact with game controllers. The library is actively maintained, with releases frequently aligning with new macOS SDKs and Python versions. Current version is 12.1.
pip install pyobjc-framework-gamecontrollerVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to list currently connected game controllers using the `GameController` framework. It iterates through available controllers and prints basic information about them.
Upgrade to Python 3.10+ for PyObjC 12.x, or use an older PyObjC version (e.g., PyObjC 10.x for Python 3.9).
Review code that interacts with Objective-C `init` methods, especially custom Python subclasses, to ensure correct reference handling under ARC rules.
Ensure your development and deployment environment is macOS.
If using a custom `__new__`, carefully verify `__init__` behavior and potentially adjust how objects are initialized or ensure `__new__` is handled consistently with PyObjC's expectations. Consider upgrading to a later version if possible.
When utilizing Python 3.13's free-threading with PyObjC, consult the PyObjC documentation for any specific guidelines or known issues related to threading and Objective-C interactions.