Saturday, November 22, 2008

weird bug with ctrl, alt, shift keys going haywire after running vmware on ubuntu

If I use ctrl+alt+enter to full-screen a vm in vmware, then when I return to the host, my special keys - ctrl, alt, and shift - will stop working !

The "xmodmap" command can be used to see the keycodes assigned to the modifiers. When the keys are working fine,
root@vmathew-laptop:~# xmodmap
xmodmap: up to 3 keys per modifier, (keycodes in parentheses):

shift Shift_L (0x32), Shift_R (0x3e)
lock Caps_Lock (0x42)
control Control_L (0x25), Control_R (0x6d)
mod1 Alt_L (0x40), Alt_R (0x71), Meta_L (0x9c)
mod2 Num_Lock (0x4d)
mod3
mod4 Super_L (0x7f), Hyper_L (0x80)
mod5 Mode_switch (0x5d), ISO_Level3_Shift (0x7c)
Now, once I run a vm in vmware and use ctrl-alt-enter, to full-screen it, and then come back to the host (ctrl-alt), the output goes.
root@vmathew-laptop:~# xmodmap
xmodmap: up to 1 keys per modifier, (keycodes in parentheses):

shift
lock
control
mod1
mod2
mod3
mod4
mod5
The fix is to use the "setxkbmap" command. This will restore the keycodes for the modifier keys.

[Ref]
http://ubuntuforums.org/showthread.php?t=792737
http://ubuntuforums.org/showthread.php?p=4990785

.

No comments: