Skip to content

Commit

Permalink
fix 输入时按键屏蔽BackTAB 未正常工作;
Browse files Browse the repository at this point in the history
减少调试信息刷屏
  • Loading branch information
way-zer committed Mar 5, 2022
1 parent 211af97 commit a65375e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
2 changes: 1 addition & 1 deletion IME_Fixer.iml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<orderEntry type="module-library">
<library>
<CLASSES>
<root url="jar://E:/PORTABLE-Portable/学术端135-2.9.1(输入法修复).jar!/" />
<root url="jar://E:/PORTABLE-Portable/学术端135-2.13.6.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
Expand Down
12 changes: 6 additions & 6 deletions jni/immHelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ LRESULT winProc(HWND hWnd, int msg, WPARAM wParam, LPARAM lParam)
case WM_KEYDOWN:
case WM_SYSKEYDOWN:
UINT key = (lParam >> 16) & 0xff;
bool extKey = (lParam >> 17) & 1;
UINT vKey = MapVirtualKey(key + extKey * 0xe000, MAPVK_VSC_TO_VK);
// log("KEYDOWN " + std::to_string(wParam) + " " + std::to_string(key) + " " + std::to_string(vKey));
bool extKey = (lParam >> 24) & 1;
UINT vKey = MapVirtualKey(key + extKey * KEYEVENTF_EXTENDEDKEY, MAPVK_VSC_TO_VK);
// log("KEYDOWN " + std::to_string(wParam) + " " + std::to_string(key) + (extKey ? 'E' : ' ') + " " + std::to_string(vKey));

if (wParam == VK_PROCESSKEY) //in COMPOSITION
if (wParam == VK_PROCESSKEY) // in COMPOSITION
{
//block some keys, according to SDLInput where see these keys as keyTyped.
// block some keys, according to SDLInput where see these keys as keyTyped.
switch (vKey)
{
case VK_BACK:
Expand Down Expand Up @@ -99,7 +99,7 @@ int setPos(int x, int y)
option.ptCurrentPos.x = x;
option.ptCurrentPos.y = y;
HIMC himc = ImmGetContext(window);
if (himc != NULL) //When not focus, context is Null
if (himc != NULL) // When not focus, context is Null
{
int bb = ImmSetCompositionWindow(himc, &option);
ImmReleaseContext(window, himc);
Expand Down
5 changes: 2 additions & 3 deletions src/cf/wayzer/imeFix/MODMain.java
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,8 @@ public void draw(float x, float y, float width, float height){
e.printStackTrace();
}
if(lastFocus.getAndSet(focus) != focus){
boolean show = focus instanceof TextField;
Log.infoTag("IMEFix", "setOpen(" + show + "):" + JNIImpl.setOpen(show));
Log.infoTag("IMEFix", "setPos" + vec2 + JNIImpl.setPos((int)vec2.x, (int)vec2.y));
JNIImpl.setOpen(focus instanceof TextField);
JNIImpl.setPos((int)vec2.x, (int)vec2.y);
}
});
}catch(Throwable e){
Expand Down

0 comments on commit a65375e

Please sign in to comment.