mirror of
https://github.com/glfw/glfw.git
synced 2025-06-15 04:02:31 +00:00
Win32: Rename commit function
The data to commit is a result-string rather than preedit.
This commit is contained in:
parent
4cdabc29f2
commit
15a64185b0
@ -636,26 +636,26 @@ static GLFWbool getImmPreedit(_GLFWwindow* window)
|
|||||||
return GLFW_TRUE;
|
return GLFW_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static GLFWbool commitImmPreedit(_GLFWwindow* window)
|
static GLFWbool commitImmResultStr(_GLFWwindow* window)
|
||||||
{
|
{
|
||||||
HIMC hIMC;
|
HIMC hIMC;
|
||||||
LONG preeditBytes;
|
LONG bytes;
|
||||||
|
|
||||||
if (!window->callbacks.character)
|
if (!window->callbacks.character)
|
||||||
return GLFW_FALSE;
|
return GLFW_FALSE;
|
||||||
|
|
||||||
hIMC = ImmGetContext(window->win32.handle);
|
hIMC = ImmGetContext(window->win32.handle);
|
||||||
// get preedit data sizes
|
// get preedit data sizes
|
||||||
preeditBytes = ImmGetCompositionStringW(hIMC, GCS_RESULTSTR, NULL, 0);
|
bytes = ImmGetCompositionStringW(hIMC, GCS_RESULTSTR, NULL, 0);
|
||||||
|
|
||||||
if (preeditBytes > 0)
|
if (bytes > 0)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
int length = preeditBytes / sizeof(WCHAR);
|
int length = bytes / sizeof(WCHAR);
|
||||||
LPWSTR buffer = _glfw_calloc(preeditBytes, 1);
|
LPWSTR buffer = _glfw_calloc(bytes, 1);
|
||||||
|
|
||||||
// get preedit data
|
// get preedit data
|
||||||
ImmGetCompositionStringW(hIMC, GCS_RESULTSTR, buffer, preeditBytes);
|
ImmGetCompositionStringW(hIMC, GCS_RESULTSTR, buffer, bytes);
|
||||||
|
|
||||||
for (i = 0; i < length; i++)
|
for (i = 0; i < length; i++)
|
||||||
window->callbacks.character((GLFWwindow*) window, buffer[i]);
|
window->callbacks.character((GLFWwindow*) window, buffer[i]);
|
||||||
@ -968,7 +968,7 @@ static LRESULT CALLBACK windowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM l
|
|||||||
window->nblocks = 0;
|
window->nblocks = 0;
|
||||||
window->ntext = 0;
|
window->ntext = 0;
|
||||||
_glfwInputPreedit(window, 0);
|
_glfwInputPreedit(window, 0);
|
||||||
commitImmPreedit(window);
|
commitImmResultStr(window);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
if (lParam & GCS_COMPSTR)
|
if (lParam & GCS_COMPSTR)
|
||||||
|
Loading…
Reference in New Issue
Block a user