Win32 IME: Rename SetInputLanguage()
GHOST_ImeWin32::SetInputLanguage() has a confusing name because it does not set the input language. It actually retrieves the current input locale from the OS and caches the value of the current input language ID. Therefore this patch renames it to "UpdateInputLanguage" Differential Revision: https://developer.blender.org/D12134 Reviewed by Ray Molenkamp
This commit is contained in:
parent
1d1020b79f
commit
07b702f828
@ -46,13 +46,13 @@ GHOST_ImeWin32::~GHOST_ImeWin32()
|
||||
{
|
||||
}
|
||||
|
||||
void GHOST_ImeWin32::SetInputLanguage()
|
||||
void GHOST_ImeWin32::UpdateInputLanguage()
|
||||
{
|
||||
/**
|
||||
* Retrieve the current input language.
|
||||
* Store the current input language.
|
||||
*/
|
||||
HKL keyboard_layout = ::GetKeyboardLayout(0);
|
||||
input_language_id_ = LOWORD(keyboard_layout);
|
||||
HKL input_locale = ::GetKeyboardLayout(0);
|
||||
input_language_id_ = LOWORD(input_locale);
|
||||
}
|
||||
|
||||
WORD GHOST_ImeWin32::GetInputLanguage()
|
||||
|
@ -88,7 +88,7 @@ class GHOST_EventIME : public GHOST_Event {
|
||||
* An application CAN call ::DefWindowProc().
|
||||
* 2.5. WM_INPUTLANGCHANGE (0x0051)
|
||||
* Call the functions listed below:
|
||||
* - GHOST_ImeWin32::SetInputLanguage().
|
||||
* - GHOST_ImeWin32::UpdateInputLanguage().
|
||||
* An application CAN call ::DefWindowProc().
|
||||
*/
|
||||
|
||||
@ -149,7 +149,7 @@ class GHOST_ImeWin32 {
|
||||
/**
|
||||
* Retrieves the input language from Windows and update it.
|
||||
*/
|
||||
void SetInputLanguage();
|
||||
void UpdateInputLanguage();
|
||||
|
||||
/* Returns the current input language id. */
|
||||
WORD GetInputLanguage();
|
||||
|
@ -1424,7 +1424,7 @@ LRESULT WINAPI GHOST_SystemWin32::s_wndProc(HWND hwnd, UINT msg, WPARAM wParam,
|
||||
case WM_INPUTLANGCHANGE: {
|
||||
system->handleKeyboardChange();
|
||||
#ifdef WITH_INPUT_IME
|
||||
window->getImeInput()->SetInputLanguage();
|
||||
window->getImeInput()->UpdateInputLanguage();
|
||||
window->getImeInput()->UpdateConversionStatus(hwnd);
|
||||
#endif
|
||||
break;
|
||||
@ -1471,7 +1471,7 @@ LRESULT WINAPI GHOST_SystemWin32::s_wndProc(HWND hwnd, UINT msg, WPARAM wParam,
|
||||
}
|
||||
case WM_IME_SETCONTEXT: {
|
||||
GHOST_ImeWin32 *ime = window->getImeInput();
|
||||
ime->SetInputLanguage();
|
||||
ime->UpdateInputLanguage();
|
||||
ime->CreateImeWindow(hwnd);
|
||||
ime->CleanupComposition(hwnd);
|
||||
ime->CheckFirst(hwnd);
|
||||
|
Loading…
Reference in New Issue
Block a user