Browse Source

Set _ignoreWmChar when IME sends a ImeProcessed key to prevent input via WM_CHAR (#12942)

pull/12958/head
Benedikt Stebner 3 years ago
committed by GitHub
parent
commit
8f7e055392
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 19
      src/Windows/Avalonia.Win32/WindowImpl.AppWndProc.cs

19
src/Windows/Avalonia.Win32/WindowImpl.AppWndProc.cs

@ -775,12 +775,19 @@ namespace Avalonia.Win32
if (message == WindowsMessage.WM_KEYDOWN)
{
// Handling a WM_KEYDOWN message should cause the subsequent WM_CHAR message to
// be ignored. This should be safe to do as WM_CHAR should only be produced in
// response to the call to TranslateMessage/DispatchMessage after a WM_KEYDOWN
// is handled.
_ignoreWmChar = e.Handled;
}
if(e is RawKeyEventArgs args && args.Key == Key.ImeProcessed)
{
_ignoreWmChar = true;
}
else
{
// Handling a WM_KEYDOWN message should cause the subsequent WM_CHAR message to
// be ignored. This should be safe to do as WM_CHAR should only be produced in
// response to the call to TranslateMessage/DispatchMessage after a WM_KEYDOWN
// is handled.
_ignoreWmChar = e.Handled;
}
}
if (s_intermediatePointsPooledList.Count > 0)
{

Loading…
Cancel
Save