From c2675d74c52188938073c6e0c4a3f594c6e0b424 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Sun, 6 Nov 2022 10:52:20 -0800 Subject: [PATCH] Revert "cocoa: Discard the IME Candidate Window immediately when Escape is pressed" This reverts commit 0d76e2a8a1a8e6a2801123587c2205a288d49406, as it introduced other issues: https://github.com/libsdl-org/SDL/pull/6486#issuecomment-1304684865 --- src/video/cocoa/SDL_cocoakeyboard.m | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/src/video/cocoa/SDL_cocoakeyboard.m b/src/video/cocoa/SDL_cocoakeyboard.m index 56e109b19..096b71a4c 100644 --- a/src/video/cocoa/SDL_cocoakeyboard.m +++ b/src/video/cocoa/SDL_cocoakeyboard.m @@ -180,13 +180,6 @@ return [NSArray array]; } -// Discard the IME Candidate Window -- (void)cancelOperation:(id)sender -{ - [[self inputContext] discardMarkedText]; - [self unmarkText]; -} - @end static void @@ -415,11 +408,6 @@ Cocoa_HandleKeyEvent(_THIS, NSEvent *event) SDL_Log("The key you just pressed is not recognized by SDL. To help get this fixed, report this to the SDL forums/mailing list or to Christian Walther . Mac virtual key code is %d.\n", scancode); } #endif - /* Discard the IME Candidate Window immediately */ - if (code == SDL_SCANCODE_ESCAPE) { - [data.fieldEdit cancelOperation:NULL]; - } - if (SDL_EventState(SDL_TEXTINPUT, SDL_QUERY)) { /* FIXME CW 2007-08-16: only send those events to the field editor for which we actually want text events, not e.g. esc or function keys. Arrow keys in particular seem to produce crashes sometimes. */ [data.fieldEdit interpretKeyEvents:[NSArray arrayWithObject:event]];