I'm not an expert here, but maybe my thoughts will help someone. If you check Console.app when press headset button, I see in console:
bluetoothaudiod Signpost 1 AVRCP Pause
mediaremoted Received broadcast command from client :
mediaremoted No destination client can be found for command , and the option to launch the app was not included. Dropping command.
bluetoothaudiod Pause Release
The idea is to register the program as "mediaremoted client" somehow, so that daemon send button press events to that "client".
这个新版本是在 swift (我正在学习), 最终将是一个完整的重写 (再次)。 我应该有一个版本在下周的测试。
Hey, good news.
I have a working prototype that's intercepting bluetooth key-presses and replaying them as media keys. It also keeps iTunes from starting when it's running (and no more hacky unloading daemons via launchctl).
This new version is in swift (which I'm learning) and will ultimately be a complete re-write (again). I should have a version up in the next week for testing.