mirror of
https://github.com/Ryujinx/SDL.git
synced 2025-01-12 04:15:40 +00:00
cocoa: Discard the IME Candidate Window immediately when Escape is pressed
This commit is contained in:
parent
15a9890919
commit
0d76e2a8a1
|
@ -180,6 +180,13 @@
|
||||||
return [NSArray array];
|
return [NSArray array];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Discard the IME Candidate Window
|
||||||
|
- (void)cancelOperation:(id)sender
|
||||||
|
{
|
||||||
|
[[self inputContext] discardMarkedText];
|
||||||
|
[self unmarkText];
|
||||||
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -408,6 +415,11 @@ 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 <https://discourse.libsdl.org/> or to Christian Walther <cwalther@gmx.ch>. Mac virtual key code is %d.\n", scancode);
|
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 <https://discourse.libsdl.org/> or to Christian Walther <cwalther@gmx.ch>. Mac virtual key code is %d.\n", scancode);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
/* Discard the IME Candidate Window immediately */
|
||||||
|
if (code == SDL_SCANCODE_ESCAPE) {
|
||||||
|
[data.fieldEdit cancelOperation:NULL];
|
||||||
|
}
|
||||||
|
|
||||||
if (SDL_EventState(SDL_TEXTINPUT, SDL_QUERY)) {
|
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. */
|
/* 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]];
|
[data.fieldEdit interpretKeyEvents:[NSArray arrayWithObject:event]];
|
||||||
|
|
Loading…
Reference in a new issue