So as noted in Sathya's comment, he is running under Vmware.
The reason this doesn't work is because VMware Player is taking control of Ctrl+Alt, because that's the key combination it uses to "break out" of the VM.
There are two ways you can fix this:
Override
There is an escape override built into VMware which overrides the breakout combination, by tapping Space while holding down the breakout combination, before hitting your desired key So for example, if you wanted to go to the right workspace you would hold down Ctrl+Alt, tap Space and then tap Right.
Change the Combination
Change the breakout combination. To do this, edit preferences.ini (in Windows 7 it's in C:\Users\$YOUR_USERNAME$\AppData\Roaming\VMware
, if you can't find it search) and add:
pref.hotkey.shift = "true"
pref.hotkey.alt = "true"
pref.hotkey.control = "true"
This remaps the breakout combination to Ctrl+Alt+Shift.
Before you say anything, yes, I realise that this is also used in Ubuntu, to move windows between workspaces. Unfortunately, that is the best I've been able to come up with so far. You are supposed to be able to be as specific as left or right control, but they don't work for me, leftControl etc just maps back to both.
References:
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:
xmodmap: up to 4 keys per modifier, (keycodes in parentheses):
shift Shift_L (0x32), Shift_R (0x3e)
lock Caps_Lock (0x42)
control Control_L (0x25), Caps_Lock (0x42), Control_R (0x69)
mod1 Alt_L (0x40), Alt_R (0x6c), Meta_L (0xcd)
mod2 Num_Lock (0x4d)
mod3
mod4 Super_L (0x85), Super_R (0x86), Super_L (0xce), Hyper_L (0xcf)
mod5 ISO_Level3_Shift (0x5c), Mode_switch (0xcb)
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:
xmodmap: up to 0 keys per modifier, (keycodes in parentheses):
shift
lock
control
mod1
mod2
mod3
mod4
mod5
Running setxkbmap
resets the keyboard mapping and temporarily resolves the issue. Playing with xmodmap
, 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 use xmodmap
.
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:
xmodmap: up to 4 keys per modifier, (keycodes in parentheses):
shift Shift_L (0x32), Shift_R (0x3e)
lock
control Control_L (0x25), Control_L (0x42), Control_R (0x69)
mod1 Alt_L (0x40), Alt_R (0x6c), Meta_L (0xcd)
mod2 Num_Lock (0x4d)
mod3
mod4 Super_L (0x85), Super_R (0x86), Super_L (0xce), Hyper_L (0xcf)
mod5 ISO_Level3_Shift (0x5c), Mode_switch (0xcb)
Best Answer
Found it! It seems that VMWare uses the keys
Ctrl+Alt+Left/Right
, So there are two things you can do:1. Change VMWare's Default keys - Go to
VMWare > Edit > Preferences > Hot Keys
and select some other combination2. Change Ubuntu's Shortcut - Go to
System Settings > Keyboard > Shortcuts > Navigation
and select some other combination forSwitch to Workspace Left/Right