Skip to content

Commit

Permalink
Remove IME related code in XNA KeyboardEventInput
Browse files Browse the repository at this point in the history
SadPencil authored Jan 28, 2025

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent 4cdf488 commit 8eb8ecf
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions Input/KeyboardEventInput.cs
Original file line number Diff line number Diff line change
@@ -37,7 +37,8 @@ public static class KeyboardEventInput
private static bool initialized;
private static IntPtr prevWndProc;
private static WNDPROC hookProcDelegate;
private static HIMC hIMC;

// private static HIMC hIMC;

/// <summary>
/// Initialize the TextInput with the given GameWindow.
@@ -72,7 +73,8 @@ public static void Initialize(GameWindow window)
prevWndProc = result;
}

hIMC = PInvoke.ImmGetContext((HWND)window.Handle);
// hIMC = PInvoke.ImmGetContext((HWND)window.Handle);

initialized = true;
}

@@ -102,15 +104,15 @@ private static LRESULT HookProc(HWND hWnd, uint msg, WPARAM wParam, LPARAM lPara
CharEntered?.Invoke(null, new KeyboardEventArgs((char)wParam.Value, (int)lParam.Value));
break;

case PInvoke.WM_IME_SETCONTEXT:
if (wParam == 1)
PInvoke.ImmAssociateContext(hWnd, hIMC);
break;
// case PInvoke.WM_IME_SETCONTEXT:
// if (wParam == 1)
// PInvoke.ImmAssociateContext(hWnd, hIMC);
// break;

case PInvoke.WM_INPUTLANGCHANGE:
PInvoke.ImmAssociateContext(hWnd, hIMC);
returnCode = (LRESULT)1;
break;
// case PInvoke.WM_INPUTLANGCHANGE:
// PInvoke.ImmAssociateContext(hWnd, hIMC);
// returnCode = (LRESULT)1;
// break;
}

return returnCode;

0 comments on commit 8eb8ecf

Please sign in to comment.