From e2fb2d12413fa765016c0e373b5016f1bdca04f6 Mon Sep 17 00:00:00 2001 From: rdb Date: Mon, 16 Sep 2024 13:30:06 +0200 Subject: [PATCH] cocoa: Prevent eating keyUp when switching to FS from macOS' FS --- panda/src/cocoadisplay/cocoaPandaApp.mm | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/panda/src/cocoadisplay/cocoaPandaApp.mm b/panda/src/cocoadisplay/cocoaPandaApp.mm index 83f0b8ef42..d256102a2c 100644 --- a/panda/src/cocoadisplay/cocoaPandaApp.mm +++ b/panda/src/cocoadisplay/cocoaPandaApp.mm @@ -16,11 +16,11 @@ @implementation CocoaPandaApp - (void) sendEvent: (NSEvent *) event { - // This is a hack that allows us to receive cmd-key-up events correctly. - // Also prevent it from eating the inserthelp key. - if (([event type] == NSKeyUp && ([event modifierFlags] & NSCommandKeyMask)) - ||([event type] == NSKeyDown && [event keyCode] == 0x72)) { - + // This is a hack that allows us to receive cmd-key-up events correctly, as + // well as key-up events during a full-screen transition. + // Also prevent it from eating the insert/help key. + if ([event type] == NSKeyUp || + ([event type] == NSKeyDown && [event keyCode] == 0x72)) { [[self keyWindow] sendEvent: event]; } else { [super sendEvent: event];