diff options
author | Teddy Wing | 2019-03-24 12:36:42 +0100 |
---|---|---|
committer | Teddy Wing | 2019-03-24 12:36:42 +0100 |
commit | 519038bde17082020265d5ae5bda80f493f91b20 (patch) | |
tree | aecfc4627093309a5ef14c43bcd36c663d016329 /lib/char_to_key_code.h | |
parent | 8aba8891e027dc1aa5d352fb60240e704e5628d8 (diff) | |
download | DomeKey-519038bde17082020265d5ae5bda80f493f91b20.tar.bz2 |
HeadphoneKeyEventBluetooth: Initial thought with MPRemoteCommandCenter
Turns out that `MPRemoteCommandCenter` seems to work for the 'play'
button, but it has no interface for volume buttons. I remember
discovering the volume button problem when I last looked into it several
months ago, but since forgot.
This was an attempt at replicating the method in:
https://github.com/russellhancox/btrcd/blob/c3e375f/btrcd/AppDelegate.m
by setting up an `MPRemoteCommandCenter` and calling
`addTargetWithHandler:` on each button to invoke a custom handler.
Committing this for reference. In order to get volume button
functionality, we'll have to dive into lower level Bluetooth events with
AVRCP. Seems that newer headphones might even use something newer than
AVRCP, so I wonder if we'll have to use multiple Bluetooth remote
control profiles.
A bit of a pain, as there doesn't seem to be a pre-built interface for
us to do this, but I'm learning more about interacting with IOBluetooth.
Also, `MPRemoteCommandCenter` is an OS X 10.12 Sierra API, so if there's
something we can use that's available on earlier OSes, that's a plus.
Diffstat (limited to 'lib/char_to_key_code.h')
0 files changed, 0 insertions, 0 deletions