Sunday, August 3, 2008

VMWare on XOrg 6.3

A couple of months ago, after I emerged xorg 6.3, I noticed that my vmware started acting up quite a bit. It doesn't seem to recognize my correct keymap, and when I switch back into my host, my ctrl/alt/shift keybindings are all gone. I managed to put in some workarounds which I'll share here:

For the keybindings in VMWare, I added to following to my /opt/vmware/workstation/lib/config file:
xkeymap.keycode.117 = 0x151
xkeymap.keycode.112 = 0x149
xkeymap.keycode.118 = 0x152
xkeymap.keycode.119 = 0x153
xkeymap.keycode.110 = 0x147
xkeymap.keycode.115 = 0x14f

xkeymap.keycode.111 = 0x148
xkeymap.keycode.116 = 0x150
xkeymap.keycode.113 = 0x14b
xkeymap.keycode.114 = 0x14d

xkeymap.keycode.133 = 0x15b


To handle the loss of my modifiers, I wrote a script that I execute with a hotkey:

#! /bin/sh

xmodmap -e 'add Shift = Shift_L Shift_R '
xmodmap -e 'add lock = Caps_Lock'
xmodmap -e 'add control = Control_L Control_R '
xmodmap -e 'add mod1 = Alt_L Alt_L Meta_L'
xmodmap -e 'add mod2 = Num_Lock'
xmodmap -e 'add mod4 = Super_L Hyper_L'
xmodmap -e 'add mod5 = Mode_switch ISO_Level3_Shift'

No comments: