I bought a SteelSeries Stratus XL game controller for my new Apple TV today. I thought it would be fun to connect to it with Pythonista, but I ran into problems very quickly.
The whole thing seemed pretty straight forward. The objc_util package is fantastic, it is the first time I read the documentation. The GCController class should very easy to work with, especially since it should work well with only polling (I want to stay away from callbacks, handlers and blocks, at least at first): https://developer.apple.com/library/ios/documentation/GameController/Reference/GameController_RefColl/index.html
So here we go!
from objc_util import *
GCController = ObjCClass('GCController')
controllers = GCController.controllers()
print controllers
I expected to see an empty list when the controller was turned off, and a list with one element when the controller was on. Instead I got an error:
ValueError: no Objective-C class named 'GCController' found
I checked what classes are available. (This takes some time if anyone plans to run this code.)
from objc_util import *
classes = ObjCClass.get_names()
print classes
There are no classes starting with GC in the list. It would have been between 'FontSizeSliderCell' and 'GEOABExperimentAssignment'. I assume that is due to the fact that the "Game Controller Framework" is not linked into the Pythonista binary.
What a pity! I was kind of looking forward to building something to play with proper buttons. That would have been great fun.
So I assume we cannot use a controller unless @omz decides to add the "Game Controller Framework" to Pythonista. Or am I missing something?