@jamesdlin's answer is correct, but there seems to be some hidden characters in the
pref.grabOnKeyPress = "TRUE" text of that answer (and I don't have the reputation to edit it or comment on it). When I copied that text and pasted it into
%APPDATA%\VMware\preferences.ini, VMware deleted the line on next launch.
To recap: Close all VM instances and add one (or both) of the following to
%APPDATA%\VMware\preferences.ini. These work as of VMware Player 15.5.
pref.grabOnKeyPress = "TRUE" will allow you to move the mouse out of the VM, but keep the keyboard focus in the VM as long as the VM window has the focus. If you type a character, VMware will move the mouse back inside the VM, but not lock the mouse in the VM.
pref.motionUngrab = "FALSE" will lock the mouse in the VM anytime you give the VM focus and will require an unlock (usually CTRL+ALT) to free the mouse. This too solves the keyboard focus issue since the mouse cannot drift outside, but has added step of needing to unlock the mouse to work outside the VM.
You generally only need one of the two options. Personally, I prefer
pref.grabOnKeyPress = "TRUE" as it behaves more like the standard Windows focus manager and is good if you move between windows a lot.
pref.grabOnKeyPress = "TRUE"in the preferences.ini file) should behave fairly similarly. If that's still insufficient, I'd be really curious to know what your use case is.
grabOnKeyPressis very close to the experience I had on VirtualBox. If they manage to retain the mouse cursor at its original (out of window) position, they catch up with the Oracle guys :) If you promote your comment to an answer, I'll accept it.