Skip to content

Commit 7830dd2

Browse files
[[ Bug 14406 ]] Differenciate dead char and IME typing on Mac
1 parent 01d496f commit 7830dd2

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

docs/notes/bugfix-14406.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Unable to enter Chinese characters in script editor

engine/src/desktop.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -914,7 +914,10 @@ void MCPlatformHandleTextInputInsertText(MCPlatformWindowRef p_window, unichar_t
914914
// Otherwise, we have the dead char in p_chars, we need to remove the one stored first in the sequence
915915
uint1 t_char[2];
916916
t_char[1] = 0;
917-
if (s_pending_key_down -> next && MCUnicodeMapToNative(p_chars, 1, t_char[0]))
917+
// SN-2015-01-20: [[ Bug 14406 ]] If we have a series of pending keys, we have two possibilities:
918+
// - typing IME characters: the characters are native, so we use the finsertnew
919+
// - typing dead characters: the character, if we arrive here, is > 127
920+
if (*p_chars > 127 && s_pending_key_down -> next && MCUnicodeMapToNative(p_chars, 1, t_char[0]))
918921
{
919922
MCdispatcher -> wkdown(p_window, (const char *)t_char, *t_char);
920923
// SN-2014-11-03: [[ Bug 13832 ]] Enqueue the event, instead of firing it now (we are still in NSApplication's keyDown).

0 commit comments

Comments
 (0)