From a22629d2f238ce5dfa7a82b70e17c8dc016236a3 Mon Sep 17 00:00:00 2001 From: meancoot Date: Sat, 14 Dec 2013 21:34:05 -0500 Subject: [PATCH] (iOS) Fix issue where setting values could not be typed in. --- apple/iOS/platform.m | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/apple/iOS/platform.m b/apple/iOS/platform.m index feed9af655..b582421a96 100644 --- a/apple/iOS/platform.m +++ b/apple/iOS/platform.m @@ -114,14 +114,16 @@ static void handle_touch_event(NSArray* touches) } } +@interface UIApplication(Superclass) +- (void)handleKeyUIEvent:(UIEvent*)event; +@end + @interface RApplication : UIApplication @end @implementation RApplication -// iOS7: This method is called instead of sendEvent for key events; do not try to merge it -// with the sendEvent method. -- (void)handleKeyUIEvent:(UIEvent*)event +- (void)processKeyEvent:(UIEvent*)event { if ([event respondsToSelector:@selector(_gsEvent)]) { @@ -136,6 +138,13 @@ static void handle_touch_event(NSArray* touches) } } +// iOS7: This method is called instead of sendEvent for key events +- (void)handleKeyUIEvent:(UIEvent*)event +{ + [super handleKeyUIEvent:event]; + [self processKeyEvent:event]; +} + - (void)sendEvent:(UIEvent *)event { [super sendEvent:event]; @@ -143,7 +152,7 @@ static void handle_touch_event(NSArray* touches) if ([[event allTouches] count]) handle_touch_event(event.allTouches.allObjects); - [self handleKeyUIEvent:event]; + [self processKeyEvent:event]; } @end