Skip to content

Commit

Permalink
Make sure to set the scan code for KEYBDINPUT
Browse files Browse the repository at this point in the history
  • Loading branch information
sharwell committed Feb 15, 2019
1 parent fec31a9 commit 4e4ab67
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ private static void AddInputs(List<NativeMethods.INPUT> inputs, VirtualKey virtu
ki = new NativeMethods.KEYBDINPUT
{
wVk = (ushort)virtualKey,
wScan = 0,
wScan = (ushort)(NativeMethods.MapVirtualKey((uint)virtualKey, NativeMethods.MAPVK_VK_TO_VSC) & 0xFF),
dwFlags = dwFlags,
time = 0,
dwExtraInfo = IntPtr.Zero
Expand Down

0 comments on commit 4e4ab67

Please sign in to comment.