From c30505d02aa9f8b5d961f748e4b8870f35a167b2 Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Fri, 29 Jun 2018 11:33:59 +0300 Subject: [PATCH] - fixed excess keyboard events in Cocoa backend https://forum.zdoom.org/viewtopic.php?t=61104 --- src/posix/cocoa/i_input.mm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/posix/cocoa/i_input.mm b/src/posix/cocoa/i_input.mm index 78841d906..c6fc86e44 100644 --- a/src/posix/cocoa/i_input.mm +++ b/src/posix/cocoa/i_input.mm @@ -559,11 +559,13 @@ void ProcessKeyboardEvent(NSEvent* theEvent) return; } + const bool isARepeat = [theEvent isARepeat]; + if (k_allowfullscreentoggle && (kVK_ANSI_F == keyCode) && (NSCommandKeyMask & [theEvent modifierFlags]) && (NSKeyDown == [theEvent type]) - && ![theEvent isARepeat]) + && !isARepeat) { ToggleFullscreen = !ToggleFullscreen; return; @@ -573,7 +575,7 @@ void ProcessKeyboardEvent(NSEvent* theEvent) { ProcessKeyboardEventInMenu(theEvent); } - else + else if (!isARepeat) { event_t event = {};