Fix D14173: Chinese IME Full Width Numbers

Windows IME: Fix duplicated initial character when entering numbers
while in Chinese full width character mode.

See D14354 for more details.

Differential Revision: https://developer.blender.org/D14354

Reviewed by Brecht Van Lommel
This commit is contained in:
Harley Acheson 2022-03-19 09:05:10 -07:00
parent 8711483632
commit 82c852f387
Notes: blender-bot 2023-02-14 08:07:50 +01:00
Referenced by issue #96696, Windows IME: Duplicated character when entering some symbols while in Chinese full width character mode.
Referenced by issue #94868, [Windows] With Microsoft IME PinYin, when it input "0" with fullwidth at text edit, it gets "00".
1 changed files with 8 additions and 3 deletions

View File

@ -88,9 +88,14 @@ bool GHOST_ImeWin32::IsImeKeyEvent(char ascii, GHOST_TKey key)
if (IsLanguage(IMELANG_JAPANESE) && (ascii >= ' ' && ascii <= '~')) {
return true;
}
else if (IsLanguage(IMELANG_CHINESE) && ascii && strchr("!\"$'(),.:;<>?[\\]^_`/", ascii) &&
!(key == GHOST_kKeyNumpadPeriod)) {
return true;
if (IsLanguage(IMELANG_CHINESE)) {
if (ascii && strchr("!\"$'(),.:;<>?[\\]^_`/", ascii) && !(key == GHOST_kKeyNumpadPeriod)) {
return true;
}
if (conversion_modes_ & IME_CMODE_FULLSHAPE && (ascii >= '0' && ascii <= '9')) {
/* When in Full Width mode the number keys are also converted. */
return true;
}
}
}
return false;