Hi fellow devs, I have a quick question is it possible to have virtual controllers on Mac. For instance can my app exclusively manage the controller and output it into the Game Controller framework? And create a virtual controller to allow for features such as controller emulation, haptic control, and others.
Hi David
Not really.
can my app exclusively manage the controller
I don't believe you can take exclusive ownership of the source game controller device such that the OS game controller support won't see it too. Possibly with some clever use of USB DriverKit - though that's going to be source-device specific and would only work for wired connections.
create a virtual controller
This may be technically possible today using DriverKit or IOHIDUserDevice to fake a game controller device that is supported natively by macOS. But we can't guarantee this won't break in the future - the OS game controller support is designed and tested for real (physical) game controllers. There are some existing checks in the OS game controller support to ignore virtual HID devices, specifically to prevent issues arising from looping game controller input back into the OS.
What are you trying to do? It would be helpful to capture your use case in a feedback issue (to the Game Controllers feedback area).
-- Justin