tag:blogger.com,1999:blog-34808015.post774428555554623664..comments2023-07-14T21:34:24.467+09:00Comments on Programming notes: Catching Keyboard Events in iOSnacho4dhttp://www.blogger.com/profile/05226784060372265780noreply@blogger.comBlogger7125tag:blogger.com,1999:blog-34808015.post-41117929754978716262014-12-12T23:12:12.622+09:002014-12-12T23:12:12.622+09:00Any public method in iOS 7/ iOS 8 to get all key b...Any public method in iOS 7/ iOS 8 to get all key board inputs?<br />Subclass of UIApplication created and overrided the -(NSArray*)keyCommands{} method, all alpha Numeric characters are possible to print. I need keys like F1, F2, Home, etc. <br />Any help is highly appreciated.GOVINDhttps://www.blogger.com/profile/09087979046170616091noreply@blogger.comtag:blogger.com,1999:blog-34808015.post-43339573818907765652013-12-23T14:24:22.543+09:002013-12-23T14:24:22.543+09:00I tried the posted code, it can get touch event, b...I tried the posted code, it can get touch event, but can't get keyboard event.<br /><br />iOS 7 / iPad mini / xcode5G.L's Bloghttps://www.blogger.com/profile/09559031482701647708noreply@blogger.comtag:blogger.com,1999:blog-34808015.post-29780005337251895122013-04-27T09:28:30.322+09:002013-04-27T09:28:30.322+09:00Thanks for this it was really useful. Unfortunatel...Thanks for this it was really useful. Unfortunately Apple did catch it and the app was rejected. I'm left wondering how the existing apps in the appstore got away with it (or if they found some other trick).newhttps://www.blogger.com/profile/12129570461272996080noreply@blogger.comtag:blogger.com,1999:blog-34808015.post-35959207570652862422012-04-10T02:52:59.823+09:002012-04-10T02:52:59.823+09:00Hello Jie.
I haven't tried that. Regarding so...Hello Jie. <br />I haven't tried that. Regarding software keyboard events using the UITextViewDelegate has been enough so far. <br /><br />My guess is that touch events are catch by the keyboard view which interacts with the input system directly and tells it exactly what character should be input without needing to create physical keyboard events.<br /><br />I think the hack will need to be done in the software keyboard class and not in UIApplication.<br /><br />I will investigate about this and write my findings some time latter this week :)nacho4dhttps://www.blogger.com/profile/05226784060372265780noreply@blogger.comtag:blogger.com,1999:blog-34808015.post-54120248791521768562012-04-10T02:34:41.607+09:002012-04-10T02:34:41.607+09:00Thanks for the post! I wonder does the keyboard ev...Thanks for the post! I wonder does the keyboard events only apply when using an external physical keyboard? When I try this hack using virtual keyboard on touch screen, it seems only generates events "3001", which is Hand event not KeyUp nor KeyDown event.<br /><br />Is there any way to catch the input of a virtual keyboard on screen?Jie Houhttps://www.blogger.com/profile/11536403243275321588noreply@blogger.comtag:blogger.com,1999:blog-34808015.post-1600212918475021732012-02-19T01:17:01.804+09:002012-02-19T01:17:01.804+09:00If there is a "better" way of getting GS...If there is a "better" way of getting GSEvents I would like to know too!<br />Unfortunately AFAIK, at least in iOS5 and below they are part of the private APIs :(nacho4dhttps://www.blogger.com/profile/05226784060372265780noreply@blogger.comtag:blogger.com,1999:blog-34808015.post-90595456837978089162012-02-19T00:45:02.753+09:002012-02-19T00:45:02.753+09:00Thanks for posting this! I've spent the past f...Thanks for posting this! I've spent the past few hours poking around and had figured out that bluetooth keyboard events were wrapped in a UIInternalEvent, but not much more than that. Your code was perfect!<br /><br />I'm still looking for a legit way around the GSEvent calls, and will let you know if I come up with anything.<br /><br />Thanks again!<br /><br />-Ryan CumleyRyanCumleyhttps://www.blogger.com/profile/07420680044541425360noreply@blogger.com