2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
|
}
break;
case WM_IME_COMPOSITION:
{
HIMC hIMC;
int n;
char *buff;
if(osVersion.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS ||
osVersion.dwPlatformId == VER_PLATFORM_WIN32s) break; /* no Unicode */
if ((lParam & GCS_RESULTSTR) == 0) /* Composition unfinished. */
break; /* fall back to DefWindowProc */
hIMC = ImmGetContext(hwnd);
n = ImmGetCompositionStringW(hIMC, GCS_RESULTSTR, NULL, 0);
if (n > 0) {
buff = (char*) smalloc(n);
ImmGetCompositionStringW(hIMC, GCS_RESULTSTR, buff, n);
luni_send((unsigned short *)buff, n / 2, 1);
free(buff);
}
ImmReleaseContext(hwnd, hIMC);
return 1;
}
case WM_IME_CHAR:
|
|
>
>
>
>
>
>
>
>
|
|
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
|
}
break;
case WM_IME_COMPOSITION:
{
HIMC hIMC;
int n;
char *buff;
if(osVersion.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS ||
osVersion.dwPlatformId == VER_PLATFORM_WIN32s) break; /* no Unicode */
if ((lParam & GCS_RESULTSTR) == 0) /* Composition unfinished. */
break; /* fall back to DefWindowProc */
hIMC = ImmGetContext(hwnd);
n = ImmGetCompositionStringW(hIMC, GCS_RESULTSTR, NULL, 0);
if (n > 0) {
int i;
buff = (char*) smalloc(n);
ImmGetCompositionStringW(hIMC, GCS_RESULTSTR, buff, n);
/*
* 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);
return 1;
}
case WM_IME_CHAR:
|