Hello everyone,
I use GameController values to generate MIDI CCs, which is working fine, but stops working if the app is in the background.
This post asks the same question, but the answer only covers tvOS and iOS (while my app is for macOS). Can the GCController events be received and processed in the background, or do you need to keep the app active in the foreground at all times ?
Thanks a lot for your answers.
I use GameController values to generate MIDI CCs, which is working fine, but stops working if the app is in the background.
This post asks the same question, but the answer only covers tvOS and iOS (while my app is for macOS). Can the GCController events be received and processed in the background, or do you need to keep the app active in the foreground at all times ?
Thanks a lot for your answers.
Well, here is for anyone wondering too.
There is, apparently, no way to use GameController data in the background — I guess for security reasons. So if like me you were blaming app nap or trying to allow input monitoring for your app, there is no reason to search that path.
There is, however, an other way : IOKit.hid, though it is definitely not as convenient to use. By allowing input monitoring, it is then possible to get raw data from a gamepad — or anything else really — even if the app is running in the background.
There is, apparently, no way to use GameController data in the background — I guess for security reasons. So if like me you were blaming app nap or trying to allow input monitoring for your app, there is no reason to search that path.
There is, however, an other way : IOKit.hid, though it is definitely not as convenient to use. By allowing input monitoring, it is then possible to get raw data from a gamepad — or anything else really — even if the app is running in the background.