Skip to content
Jed Laundry edited this page Jun 22, 2025 · 2 revisions

SendInput and SendKeys

Because applications handle the input stream differently, you can select either the SendInput or SendKeys method of typing characters.

SendInput uses the VirtualKeyFromKey method to map each character into your current keyboard layout scancode, and then the Win32 SendInput function to send keys into the input stream - which means if you are using different keyboard layouts (particularly over RDP), this is probably the method you want.

SendKeys uses the SendKeys.Send method, which uses the same Win32 SendInput function, but with a lot more error handing - making it more robust, but lacking any support for different keyboard layouts.

Known and Resolved Issues

  • VMWare vSphere Web Console doesn't work with Chrome/Edge due to the way vSphere processes vScanCode values and what Chrome/Edge provide. #6.
    • I don't have a fix for this. I recommend you use Firefox or VMRC instead.
  • VMWare / Omnissa Horizon desktop client uses a low-level keyboard driver, which SendKeys can't send to.
    • This may be fixed in v1.6 with the SendInput method - I need feedback please!
  • Using different keyboard layouts between source and destination causes the sent keys to be mapped to the destination key location, not the intended source value. #2 #3
    • Fixed in v1.5 with the SendInput method
Clone this wiki locally