From 7f90f04c074d86031f48cae0370b2ac06b36a292 Mon Sep 17 00:00:00 2001 From: Elias Naur Date: Wed, 23 Feb 2022 15:36:39 +0100 Subject: [PATCH] app: [macOS] pass key events to system before handling them This change solves an issue where an editor key press such as backspace would apply before the IME had a chance to process it. Signed-off-by: Elias Naur --- app/os_macos.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/os_macos.m b/app/os_macos.m index 4ebe250c..b5852a32 100644 --- a/app/os_macos.m +++ b/app/os_macos.m @@ -116,9 +116,9 @@ static void handleMouse(NSView *view, NSEvent *event, int typ, CGFloat dx, CGFlo handleMouse(self, event, MOUSE_SCROLL, dx, dy); } - (void)keyDown:(NSEvent *)event { + [self interpretKeyEvents:[NSArray arrayWithObject:event]]; NSString *keys = [event charactersIgnoringModifiers]; gio_onKeys((__bridge CFTypeRef)self, (__bridge CFTypeRef)keys, [event timestamp], [event modifierFlags], true); - [self interpretKeyEvents:[NSArray arrayWithObject:event]]; } - (void)keyUp:(NSEvent *)event { NSString *keys = [event charactersIgnoringModifiers];