tags:

views:

40

answers:

1

Is it possible to use the external speaker volume controls of iphone as a control for an App you have developed?

For example as a control of a timer app for which the enable button for the timer to start counting is the top external volume button and disable timer is the lower external button.

If so, which classes of iOS 4 sdk can override those external buttons for an application or those external buttons are locked only for volume controls and nothing else?

+1  A: 

I have seen a video of the Camera+ app that supposedly uses the volume key to snap a picture (instead of touching the button on the screen). http://taptaptap.com/blog/volumesnap/

I, myself, was pretty confused when I saw that and thought it must have been a mock up or something. But I asked around and apparently, if you're running an audio player, you get notifications when the volume keys are pressed.

The idea was put forward that if you can run a silent audio on a loop and hook into the volume key notifications to do what you want.

However, I've looked at both the AVAudioPlayer and the MPMoviePlayerController class documentation and can't see any such notifications. I suspect they're private, which isn't very useful.

Jasarien