1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-01-10 09:58:01 +00:00

Jaeyoun Chung's mysterious patch that apparently makes Korean input

work properly: call luni_send() one character at a time rather than
all together after WM_IME_COMPOSITION.

[originally from svn r1494]
This commit is contained in:
Simon Tatham 2001-12-15 11:10:19 +00:00
parent 3ed0d44f16
commit efddc0a744

View File

@ -2395,9 +2395,17 @@ static LRESULT CALLBACK WndProc(HWND hwnd, UINT message,
n = ImmGetCompositionStringW(hIMC, GCS_RESULTSTR, NULL, 0);
if (n > 0) {
int i;
buff = (char*) smalloc(n);
ImmGetCompositionStringW(hIMC, GCS_RESULTSTR, buff, n);
luni_send((unsigned short *)buff, n / 2, 1);
/*
* Jaeyoun Chung reports that Korean character
* input doesn't work correctly if we do a single
* luni_send() covering the whole of buff. So
* instead we luni_send the characters one by one.
*/
for (i = 0; i < n; i += 2)
luni_send((unsigned short *)(buff+i), 1, 1);
free(buff);
}
ImmReleaseContext(hwnd, hIMC);