https://git.reactos.org/?p=reactos.git;a=commitdiff;h=deb4f4e4e28d66cf9ba98…
commit deb4f4e4e28d66cf9ba98793fb7821802fe5ac2d
Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com>
AuthorDate: Mon Oct 10 15:50:13 2022 +0900
Commit: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com>
CommitDate: Mon Oct 10 15:50:13 2022 +0900
[IMM32] Add ImmGetAppCompatFlags and epilogue of ImmProcessKey
CORE-11700
---
dll/win32/imm32/keymsg.c | 25 +++++++++++++++++++++++--
1 file changed, 23 insertions(+), 2 deletions(-)
diff --git a/dll/win32/imm32/keymsg.c b/dll/win32/imm32/keymsg.c
index 8222be3d781..a30f9b06f55 100644
--- a/dll/win32/imm32/keymsg.c
+++ b/dll/win32/imm32/keymsg.c
@@ -682,6 +682,20 @@ UINT WINAPI ImmGetVirtualKey(HWND hWnd)
return ret;
}
+DWORD WINAPI ImmGetAppCompatFlags(HIMC hIMC)
+{
+ PCLIENTIMC pClientIMC;
+ DWORD dwFlags;
+
+ pClientIMC = ImmLockClientImc(hIMC);
+ if (pClientIMC == NULL)
+ return 0;
+
+ dwFlags = pClientIMC->dwCompatFlags;
+ ImmUnlockClientImc(pClientIMC);
+ return dwFlags;
+}
+
/***********************************************************************
* ImmProcessKey(IMM32.@)
* ( Undocumented, called from user32.dll )
@@ -754,9 +768,16 @@ ImmProcessKey(HWND hWnd, HKL hKL, UINT vKey, LPARAM lParam, DWORD
dwHotKeyID)
}
}
- if (ret & IPHK_PROCESSBYIME)
+ if ((ret & IPHK_PROCESSBYIME) && (ImmGetAppCompatFlags(hIMC) &
0x10000))
{
- FIXME("TODO: We have to do something here.\n");
+ LANGID wLangID = LANGIDFROMLCID(GetSystemDefaultLCID());
+ if (PRIMARYLANGID(wLangID) != LANG_KOREAN ||
+ (vKey != VK_PROCESSKEY && !(ret & IPHK_HOTKEY)))
+ {
+ ImmTranslateMessage(hWnd, WM_KEYDOWN, VK_PROCESSKEY, lParam);
+ ret &= ~IPHK_PROCESSBYIME;
+ ret |= IPHK_SKIPTHISKEY;
+ }
}
ImmReleaseContext(hWnd, hIMC);