I'm running VirtualBox on Linux. (The virtualbox
4.3.10 package on Ubuntu 14.04 if it matters, but I'd prefer a version-agnostic solution.) I have a tweaked keyboard layout on the host (under X11), and apparently that causes VirtualBox to misinterpret some keys.
Specifically, the left “Windows” key (LWIN
for XKB) is configured with xmodmap to send
keycode 133 = Hyper_L
In VirtualBox virtual machines the key is not recognized at all. I ran showkey
on a Linux console to check, it doesn't react when I press this key.
How can I make LWIN
send the right keycode in virtual machines? The trigger can be this specific physical key or the Hyper_L
keysym. Of course other applications must not be affected; that xmodmap line is staying.
I use Sawfish as my window manager. A Sawfish-specific solution is ok, but I'm not sure it can help: it allows me to define per-window keybindings, but not for modifier keys alone. I want to run a Windows VM, so the press and release events for the key alone must be passed through to the VM (press of LWIN
→ pass a key press event to the VM), not just combinations like LWIN
+key.
If the fact that the key is a modifier makes this too hard, I'm willing to fall back to making the CAPS
(Caps Lock) key, which is bound to the Mode_switch
keysym (AltGr
) and no modifier, appear as LWIN to the VM.