mirror of
https://github.com/zydeco/minivmac4ios.git
synced 2024-09-27 12:59:00 +00:00
steal key events if handled by emulator
fixes #45 somewhat, but not for ⌘-Q or ⌘-H
This commit is contained in:
parent
1cfc5bd94f
commit
ceb0813eee
@ -100,7 +100,6 @@ static int8_t usb_to_adb_scancode[] = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
- (void)handleKeyUIEvent:(UIEvent *)event {
|
- (void)handleKeyUIEvent:(UIEvent *)event {
|
||||||
[super handleKeyUIEvent:event];
|
|
||||||
static dispatch_once_t onceToken;
|
static dispatch_once_t onceToken;
|
||||||
static BOOL handleKeyboardEvents = YES;
|
static BOOL handleKeyboardEvents = YES;
|
||||||
dispatch_once(&onceToken, ^{
|
dispatch_once(&onceToken, ^{
|
||||||
@ -113,6 +112,8 @@ static int8_t usb_to_adb_scancode[] = {
|
|||||||
BOOL emulatorIsFrontmost = [AppDelegate sharedEmulator].running && [AppDelegate sharedInstance].window.rootViewController.presentedViewController == nil;
|
BOOL emulatorIsFrontmost = [AppDelegate sharedEmulator].running && [AppDelegate sharedInstance].window.rootViewController.presentedViewController == nil;
|
||||||
if ([event isKindOfClass:keyboardEventClass] && handleKeyboardEvents && emulatorIsFrontmost) {
|
if ([event isKindOfClass:keyboardEventClass] && handleKeyboardEvents && emulatorIsFrontmost) {
|
||||||
[self handleKeyboardEvent:(UIPhysicalKeyboardEvent*)event];
|
[self handleKeyboardEvent:(UIPhysicalKeyboardEvent*)event];
|
||||||
|
} else {
|
||||||
|
[super handleKeyUIEvent:event];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user