Generating Remote Control Events from my app

浪子不回头ぞ 提交于 2019-12-03 21:42:15

Without private API, you cannot send remotecontrol event to your application.

The reason is we cannot create such an Event (UIEvent) to send out by using:

[[UIApplication sharedApplication] sendEvent:anEvent];

You can, however save a registered event then play back by calling the above-function.

I don't know if it possible for headphone events but with private API, you can send some events like: home button press, power button press or mouse events (not tested).

You should read this book:

http://www.amazon.com/gp/product/1118057651/ref=pd_lpo_sbs_dp_ss_1?pf_rd_p=1535523702&pf_rd_s=lpo-top-stripe-1&pf_rd_t=201&pf_rd_i=0321278542&pf_rd_m=ATVPDKIKX0DER&pf_rd_r=0T2AMHJCEEKJN41YJHD5

It'll be a hard work to make this works.

Take a look at GSEvent to know how to send an event to OS (iOS).

Edit: I've found 2 event types in GSEvent.GSEventType:

kGSEventHeadsetButtonDown = 1018,
kGSEventHeadsetButtonUp = 1019,

PS: - this use private API so it will be rejected if you post this app to AppStore.

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