UIEventSubtype missing elements
Asked Answered
B

2

1

The enum UIEventSubtype (iOS UIKit Framework) contains events such as play, pause, next, seek, etc. However, the iPod Access protocol contains numerous other events, such as select, up, down and back (think iPod with clickwheel). The iPod app on iOS can receive these other events and respond accordingly (move selection up/down/back in playlists), but developer apps don't have seem access to these controls.

Does anyone know a way to receive these additional events in an iOS app (for jailbreak), other than opening the /dev/tty.iap port myself (or filing a bug report with Apple and waiting)? Perhaps there's a private framework that has what I'm looking for? I looked in the IAP framework but didn't see anything interesting.

Barros answered 7/12, 2012 at 17:27 Comment(0)
B
2

@Victor Ronin had the right idea, in the Private Framework iPodUI I found a class IUAccessoryEventHandler containing methods like

- (void)handleDownArrowEvent; 
- (void)handleUpArrowEvent
- (void)handleSelectEvent

When I hooked into them with a Theos tweak and inserted logging details, I was able to see that these methods were the ones being called when an external device was sending the commands.

Update: Unfortunately, the iPodUI framework were only available in iOS 5 and 6, according to the iPhone Wiki. Not sure if or where these methods are still available.

Barros answered 6/10, 2013 at 19:48 Comment(0)
F
1

I don't have a ready answer for you, but since you are doing this on jailbroken device, you can use mobile substrate to inject code into iPod app and you can override UIApplication sendEvent to see all events, which it receives (including select, up, down etc).

Flux answered 12/12, 2012 at 19:4 Comment(3)
Thanks, that's a good idea. I'll give it a try when I get a chance (most likely next year).Barros
Finally got a chance to try this out. Made a simple hook which just wrote to syslog when sendEvent was called. Unfortunately it was only called for the IAP events that are already available to 3rd party apps as well, not the events I was hoping to access (select, up, down and back). I guess these are handled elsewhere. But thanks anyway!Barros
You had the right idea, the methods were just in iPodUI instead of the usual UIApplication.Barros

© 2022 - 2024 — McMap. All rights reserved.