Skip to content

Commit

Permalink
Fix unable to type cultural character (#15394)
Browse files Browse the repository at this point in the history
Check KeySymbol before return null in TryCreateRawKeyEventArgs to prevent skipping cultural character.

Co-authored-by: CKPhong <phong.chung@itd.com.vn>
  • Loading branch information
2 people authored and maxkatz6 committed Apr 20, 2024
1 parent 34c2c02 commit 9b8e772
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/Windows/Avalonia.Win32/WindowImpl.AppWndProc.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1191,12 +1191,11 @@ private static RawInputModifiers GetInputModifiers(PointerFlags flags)
var keyData = ToInt32(lParam);
var key = KeyInterop.KeyFromVirtualKey(virtualKey, keyData);
var physicalKey = KeyInterop.PhysicalKeyFromVirtualKey(virtualKey, keyData);
var keySymbol = KeyInterop.GetKeySymbol(virtualKey, keyData);

if (key == Key.None && physicalKey == PhysicalKey.None)
if (key == Key.None && physicalKey == PhysicalKey.None && string.IsNullOrWhiteSpace(keySymbol))
return null;

var keySymbol = KeyInterop.GetKeySymbol(virtualKey, keyData);

return new RawKeyEventArgs(
WindowsKeyboardDevice.Instance,
timestamp,
Expand Down

0 comments on commit 9b8e772

Please sign in to comment.