(iOS) Fix issue where setting values could not be typed in.

This commit is contained in:
meancoot 2013-12-14 21:34:05 -05:00
parent 4c526585f5
commit a22629d2f2

View File

@ -114,14 +114,16 @@ static void handle_touch_event(NSArray* touches)
} }
} }
@interface UIApplication(Superclass)
- (void)handleKeyUIEvent:(UIEvent*)event;
@end
@interface RApplication : UIApplication @interface RApplication : UIApplication
@end @end
@implementation RApplication @implementation RApplication
// iOS7: This method is called instead of sendEvent for key events; do not try to merge it - (void)processKeyEvent:(UIEvent*)event
// with the sendEvent method.
- (void)handleKeyUIEvent:(UIEvent*)event
{ {
if ([event respondsToSelector:@selector(_gsEvent)]) 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 - (void)sendEvent:(UIEvent *)event
{ {
[super sendEvent:event]; [super sendEvent:event];
@ -143,7 +152,7 @@ static void handle_touch_event(NSArray* touches)
if ([[event allTouches] count]) if ([[event allTouches] count])
handle_touch_event(event.allTouches.allObjects); handle_touch_event(event.allTouches.allObjects);
[self handleKeyUIEvent:event]; [self processKeyEvent:event];
} }
@end @end