Technically you can, but practically not really.
When you move the mouse cursor out of the guest screen, you're ungrabbing (releasing input) from the VM. The whole point of moving the mouse cursor out of the VM is to tell it that you no longer wish to direct input to the VM. Imagine if you could move the mouse cursor out but that the VM still took keyboard input: you'd move the mouse cursor out, click on some other window, start typing, and then keys would go to the VM, not to the window you had just clicked on. That sounds incredibly confusing. (And if you don't intend to click on another window, then why do you want to move the mouse cursor out of the VM?)
That said, you could attach a second USB keyboard to your host and then connect that as a USB device to the VM, and then your VM would have its own dedicated keyboard. (Note that doing this requires setting:
usb.generic.allowHID = "TRUE"
usb.generic.allowLastHID = "TRUE"
in the VM's .vmx
file first so that USB keyboards and mice are treated like generic USB devices. See https://kb.vmware.com/kb/1033435 for more details.)
Now, maybe you don't actually want to move the mouse cursor out of the VM. Maybe you just want it to be out of the way and are trying to move it to the corner of the screen, but you're accidentally moving it out of the VM. If that's the case, then in Workstation you can avoid that by going to Edit > Preferences > Input > Cursor and unchecking "Automatically grab and ungrab the mouse". Player doesn't provide UI to change this preference, but Player uses the same preferences file, so you can manually edit the preferences file (%APPDATA%\VMware\preferences.ini
on a Windows host, ~/.vmware/preferences
on Linux) by closing all Player instances and adding the line:
pref.motionUngrab = "FALSE"
Yes the fact is that I always end up accidentally moving mouse out of VM window when typing for example my passwords where I have numeric digits in it, ending up with writing just the part of the password until I move the mouse to get space for my hand to write on NumPad :) Unfortunately, I cannot find mentioned option Edit > Preferences > Input > Cursor in VMware Workstation 12 Player. Maybe it was available in older versions, but in this one it isn't? – IkkieCZ – 2016-03-03T09:10:33.533
Sorry, I didn't realize that you were using Player and not Workstation. In that case, you'll have to edit the preferences file yourself: Quit Player, open
%APPDATA%\VMware\preferences.ini
in a text editor, and add a line:pref.motionUngrab = "FALSE"
. – jamesdlin – 2016-03-03T11:18:34.743@IkkieCZ If this answers your question, then you should upvote this answer and mark it as the accepted answer. – jamesdlin – 2016-03-03T18:39:23.367
2I'd love it if there was the option to be able to move the mouse out of the VMWare window and still have keyboard input directed to the VM, until I clicked on something in the host. This is just how everything else works in Windows, I can type in a window even if I move the mouse away, until I clicked on some other window. – Gazihan Alankus – 2016-08-24T09:54:10.983
1
@gazialankus Can you explain why you want to move the mouse cursor out of the guest window? Note you could have keyboard input automatically go to the VM with the mouse cursor out of the window if you enable grab-on-keypress.
– jamesdlin – 2016-08-24T10:14:42.987My second and third sentences above explain why this should be the case in Windows. The other two questions already give a good reason for the user moving the mouse away. And why would I want every key to go to the guest with grab-on-keypress?? If you work for VMWare, please consider this as a feature request. If not, maybe try to be content when you don't have an answer. – Gazihan Alankus – 2016-08-24T10:33:26.597
@gazialankus You say "why would I want every key to go to the guest with grab-on-keypress", yet that's the behavior you're asking for. (Note that keys that would be processed by the host window itself would not go to the guest, and keys would go to the guest only if the host window is the active window.) Anyway, mostly I'm curious, because the typical reason is to get the mouse cursor out of the way from where you're typing, but as I mentioned, disabling auto-ungrab would achieve the same effect. – jamesdlin – 2016-08-24T17:31:16.203
@jamesdlin Oh, I'm really sorry. earlier today I tried grab-on-keypress with multiple monitors with vmware full screen on one, and I swear it was grabbing keys even after clicking on a window other than vmware. now I have only my laptop, with vmware windowed and it indeed does what I wanted, as you just pointed out. I hope I missed something in the multi-monitor case and I'll be able to keep typing after pushing the mouse away. thank you! I'll try this tomorrow. – Gazihan Alankus – 2016-08-24T19:54:43.187
works fine with multiple monitors! for others in the same situation, I have everything in the Preferences/Input on. Namely "Grab keyboard and mouse input on mouse click", "Grab keyboard and mouse input on key press", "Automatically grab and ungrab the mouse" and "Hide cursor on grab". thanks again! – Gazihan Alankus – 2016-08-25T06:50:00.167
1When I move the mouse on another monitor, then press a key, the key press goes to the guest as expected, but the mouse come back right in the middle of the screen on the guest. I would like multi-monitor VM to be as intuitive as any modern OS would be – Bilow – 2018-07-30T12:40:24.200
Also, the keyboard isn't grabbed when pressing Ctrl+C (sending SIGINT to a terminal on linux guest) – Bilow – 2018-07-30T16:00:01.820
@Bilow Regarding Ctrl+C: Are you talking about grab-on-keypress or using a dedicated USB keyboard to the VM? If you're referring to grab-on-keypress, Ctrl+C doesn't work because it's the same shortcut key as Edit > Copy. Shortcut keys that correspond to menu items won't trigger automatic grab since otherwise grab-on-keypress would completely break keyboard accessibility for the UI. – jamesdlin – 2018-07-30T16:42:50.800
@Bilow Regarding the mouse cursor: To clarify, where do you expect the guest mouse cursor to be? Your definition of intuitive is not necessarily the same as everyone else's. The guest mouse cursor can't be where the host's is (outside of the guest window). The VM grabs both keyboard and mouse input or neither. Grabbing just one or the other is also confusing. (BTW, it will happen whenever the mouse cursor is outside of the guest window and you grab. It not related to multiple monitors or even grab-on-keypress.) – jamesdlin – 2018-07-30T16:43:10.347