From 59205a4cafb835d10f8cade5311a3c77bed800bc Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 2 Jun 2019 17:36:16 +0530 Subject: [PATCH] macOS: Fix a regression in the previous release that broke using :kbd:`ctrl+shift+tab` Fixes #1671 --- docs/changelog.rst | 3 +++ glfw/cocoa_init.m | 12 ++++++++---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/docs/changelog.rst b/docs/changelog.rst index 825d93611..65b5b1244 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -12,6 +12,9 @@ To update |kitty|, :doc:`follow the instructions `. or inserting into the terminal. You can have them on separate lines, separated by arbitrary characters, or even serialized as JSON (:iss:`1665`) +- macOS: Fix a regression in the previous release that broke using + :kbd:`ctrl+shift+tab` (:iss:`1671`) + 0.14.1 [2019-05-29] --------------------- diff --git a/glfw/cocoa_init.m b/glfw/cocoa_init.m index 0f32c01a4..3de6bd09f 100644 --- a/glfw/cocoa_init.m +++ b/glfw/cocoa_init.m @@ -313,10 +313,13 @@ - (void)render_frame_received:(id)displayIDAsID static inline bool is_ctrl_tab(NSEvent *event, NSEventModifierFlags modifierFlags) { - if (modifierFlags == NSEventModifierFlagControl || modifierFlags == ( - NSEventModifierFlagControl | NSEventModifierFlagShift)) { - if ([event.charactersIgnoringModifiers isEqualToString:@"\t"]) return true; - } + NSLog(@"%@\n", event.charactersIgnoringModifiers); + if ( + (modifierFlags == NSEventModifierFlagControl && + [event.charactersIgnoringModifiers isEqualToString:@"\t"]) || + (modifierFlags == (NSEventModifierFlagControl | NSEventModifierFlagShift) && + [event.charactersIgnoringModifiers isEqualToString:@"\x19"]) + ) return true; return false; } @@ -343,6 +346,7 @@ int _glfwPlatformInit(void) NSEventModifierFlags modifierFlags = [event modifierFlags] & NSEventModifierFlagDeviceIndependentFlagsMask; if (is_ctrl_tab(event, modifierFlags) || is_cmd_period(event, modifierFlags)) { // Cocoa swallows Ctrl+Tab to cycle between views + NSLog(@"1111111111\n"); [[NSApp keyWindow].contentView keyDown:event]; }