Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Send Keyboard Input to VMWare from C#

I want to send mouse clicks and keyboards keys to a window running a virtual machine such as VMware or VirtualBox. I want to pilotate it from the host OS, from an application written in C#.

I can move and click the mouse.

But I can't send keyboard input. I tried with SendKeys but it doesn't work. With every other "normal" window, it works. But I think it's related to how VMware or Virtual BOx intercept keyboard events.

Any idea?

like image 823
Robert Avatar asked Apr 17 '10 16:04

Robert


People also ask

How do I send keys to a virtual machine?

Send the desired key input to the virtual machine. On Windows, select VMRC > Send Ctrl+Alt+Del. On Linux, select Virtual Machine > Send Ctrl+Alt+Del. On macOS, select Virtual Machine > Send Ctrl+Alt+Del to send the Ctrl+Alt+Del sequence or Virtual Machine > Send Key to send other key input.

How do I capture a keyboard in VMware?

Force grab or force release keyboard and mouse input. On the keyboard, press Cmd+G.

What is send Ctrl-Alt Del VMware?

You can use the Ctrl+Alt+Delete key sequence to shut down or log off of a guest operating system.

How do I press a Windows key in VMware console?

To enable this key, click the Open Settings Window toolbar button in the sidebar and turn on Enable Windows Key for Desktops. Important: After you turn on Enable Windows Key for Desktops, you must press Ctrl+Win (on Windows), Ctrl+Command (on Mac), or Ctrl+Search (on Chromebook) to simulate pressing the Windows key.


1 Answers

Yes, SendKeys and VMWare (like mstsc) don't love one each other.
But I believe that VMWare has some API functions for do so. Try to search here: http://www.vmware.com/support/pubs/sdk_pubs.html

like image 54
rodnower Avatar answered Sep 25 '22 12:09

rodnower