don't forward physical keyboard events to emulated machine when presenting another view controller

This commit is contained in:
Jesús A. Álvarez 2016-06-06 20:57:09 +02:00
parent b2194bfcc5
commit 4e268e144d

View File

@ -110,7 +110,8 @@ static int8_t usb_to_adb_scancode[] = {
handleKeyboardEvents = NO; handleKeyboardEvents = NO;
} }
}); });
if ([event isKindOfClass:keyboardEventClass] && handleKeyboardEvents) { BOOL emulatorIsFrontmost = [AppDelegate sharedEmulator].running && [AppDelegate sharedInstance].window.rootViewController.presentedViewController == nil;
if ([event isKindOfClass:keyboardEventClass] && handleKeyboardEvents && emulatorIsFrontmost) {
[self handleKeyboardEvent:(UIPhysicalKeyboardEvent*)event]; [self handleKeyboardEvent:(UIPhysicalKeyboardEvent*)event];
} }
} }