From 4e268e144d48fcaa97f24d9874c96d17fa258613 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jesu=CC=81s=20A=2E=20A=CC=81lvarez?= Date: Mon, 6 Jun 2016 20:57:09 +0200 Subject: [PATCH] don't forward physical keyboard events to emulated machine when presenting another view controller --- Mini vMac/MNVMApplication.m | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Mini vMac/MNVMApplication.m b/Mini vMac/MNVMApplication.m index 82756d3..0c9d2c6 100644 --- a/Mini vMac/MNVMApplication.m +++ b/Mini vMac/MNVMApplication.m @@ -110,7 +110,8 @@ static int8_t usb_to_adb_scancode[] = { 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]; } }