Skip to content

Commit 4e268e1

Browse files
committed
don't forward physical keyboard events to emulated machine when presenting another view controller
1 parent b2194bf commit 4e268e1

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Mini vMac/MNVMApplication.m

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,8 @@ - (void)handleKeyUIEvent:(UIEvent *)event {
110110
handleKeyboardEvents = NO;
111111
}
112112
});
113-
if ([event isKindOfClass:keyboardEventClass] && handleKeyboardEvents) {
113+
BOOL emulatorIsFrontmost = [AppDelegate sharedEmulator].running && [AppDelegate sharedInstance].window.rootViewController.presentedViewController == nil;
114+
if ([event isKindOfClass:keyboardEventClass] && handleKeyboardEvents && emulatorIsFrontmost) {
114115
[self handleKeyboardEvent:(UIPhysicalKeyboardEvent*)event];
115116
}
116117
}

0 commit comments

Comments
 (0)