Is it possible to use Pythonista APIs to get notifications for the the volume-up and volume-down switches that are on an earphone set plugged into the earphone jack of an iPhone 6s? I want to access just one button, and get up and down notifications, similar to the touch_began and touch_ended notifications for a screen button.
I am currently using tapping on the screen to control something. I have an electrical engineering background, so I can wire a button up and plug that in, while satifying the impedances for the other connections on the plug. I'd like to be able to push that button to control something, rather than having to push on the screen of the phone.
I have no idea how to do this. Note, I do not care if this also affects the audio volume. I can have the audio muted. I just want to access the up-event and down-event when the button is depressed and let go.
I found this page, but it does not appear to have the information for the volume control switches that are plugged in with earphones.
https://developer.apple.com/documentation/audiotoolbox/system_sound_services