From c6039fc399714d04faa5395d3572514f857a3385 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 14 Oct 2021 20:27:22 +0530 Subject: [PATCH] Also passthrough Insert and Shift+Insert which cocoa seems to intercept --- glfw/cocoa_init.m | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/glfw/cocoa_init.m b/glfw/cocoa_init.m index e90282de9..dcc42aab2 100644 --- a/glfw/cocoa_init.m +++ b/glfw/cocoa_init.m @@ -492,8 +492,14 @@ is_modified_special_key(NSEvent *event, NSEventModifierFlags modifierFlags) { return true; } } - // ctrl+whatever+esc and cmd+whatever+esc - if (ch == 0x1b && (modifierFlags & (NSEventModifierFlagCommand | NSEventModifierFlagControl))) return true; + switch (ch) { + case 0x1b: // Esc + if (modifierFlags & (NSEventModifierFlagCommand | NSEventModifierFlagControl)) return true; + break; + case NSInsertFunctionKey: // Insert + if (!modifierFlags || modifierFlags == NSEventModifierFlagShift) return true; + break; + } return false; }