Before I launch a virtual machine in VMware, all the modifier keys function properly. Even when I launch VMware, but before I start the virtual machine everything works great.
However once I start a virtual machine my left Ctrl and right Shift keys stop functioning. They simply have no affect.
Here are a few observations that might lead to something:
- My left Shift still keeps working.
- I mapped my Caps Lock to Ctrl and it works properly.
- Executing
sudo setxkbmap
temporarily sets everything in order. Once VMware gains focus and I type something, problem comes back. - Problem persists even after I quit VMware.
This is the first time I'm using Unity (I have been using Gnome for a long time) and I'm suspecting the problem is related to that. Any ideas why this might be happening?
Best Answer
TLDR:
In Gnome Tweak Tool, set "Ctrl key position" to "Caps Lock as Ctrl" and "Caps Lock key behavior" to "Caps Lock is disabled".
Full story:
The problem appears to be how Ubuntu is remapping the CapsLock key. When Gnome Tweak Tool's "Caps Lock key behavior" property is set to "Make Caps an additional Ctrl", xmodmap reports:
The problem appears to be that both lock and control list "Caps_Lock (0x42)". Everything works well until you set focus into a VMWare VM (I tested using VMWare Player). After focusing VMWare's window,
xmodmap
will report an empty mapping:Running
setxkbmap
resets the keyboard mapping and temporarily resolves the issue. Playing withxmodmap
, I found that removing Caps_Lock (0x42) from lock stopped VMWare from flushing the keyboard mappings. But, Ubuntu 14.04 ignores.Xmodmap
files, so there was no simple method to usexmodmap
.We can fix the root-cause of this situation by changing two settings in Gnome Tweak Tool, as described at the top of this post. Doing so will properly configure the keyboard mappings so that Caps_Lock (0x42) does not show up in two locations: