Skip to content

Commit 1878a12

Browse files
[[ Bug 15305 ]] Send appropriate keyDown message for Option-<key>
Use better way to find out when keys are IME entries
1 parent 972a343 commit 1878a12

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

engine/src/desktop.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -965,8 +965,8 @@ void MCPlatformHandleTextInputInsertText(MCPlatformWindowRef p_window, unichar_t
965965
// of the whole word are individual Kanji as well, and Unicode valid alphanum.
966966
// (they would be appended to the in-process IME string).
967967
// SN-2015-05-05: [[ Bug 15305 ]] Check that s_pending_key_down is not
968-
// nil before trying to use it.
969-
if (s_pending_key_down && *p_chars > 127 && p_char_count == 1 && MCUnicodeMapToNative(p_chars, 1, t_char[0]))
968+
// nil before trying to use it, and use IME only if p_mark says so.
969+
if (s_pending_key_down && !p_mark)
970970
{
971971
MCAutoStringRef t_mapped_char;
972972
MCPlatformKeyCode t_mapped_key_code;

engine/src/object.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -527,9 +527,11 @@ Boolean MCObject::kdown(MCStringRef p_string, KeySym key)
527527
// Special keys as their number converted to a string, the rest by value
528528
// SN-2014-12-08: [[ Bug 12681 ]] Avoid to print the keycode in case we have a
529529
// numeric keypad keycode.
530-
if (key > 0x7F && (key & XK_Class_mask) == XK_Class_compat && (key < XK_KP_Space || key > XK_KP_Equal))
531-
/* UNCHECKED */ MCStringFormat(&t_string, "%ld", key);
532-
else if (MCmodifierstate & MS_CONTROL)
530+
// SN-2015-05-05: [[ Bug 15305 ]] Ensure that the keys are not printing
531+
// their numeric value, if not wanted.
532+
if (key > 0xFF && (key & XK_Class_mask) == XK_Class_compat && (key < XK_KP_Space || key > XK_KP_Equal))
533+
/* UNCHECKED */ MCStringFormat(&t_string, "%ld", key);
534+
else if (MCmodifierstate & MS_CONTROL)
533535
/* UNCHECKED */ MCStringFormat(&t_string, "%c", (char)key);
534536
else
535537
t_string = p_string;

0 commit comments

Comments
 (0)