UIEventSubtype missing elements

隐身守侯 提交于 2019-12-13 01:46:46

问题


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.


回答1:


@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.




回答2:


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).



来源:https://stackoverflow.com/questions/13768044/uieventsubtype-missing-elements

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!