@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.