Workstation User’s Manual
344 VMware, Inc.
To change how a specific key is mapped
1PoweroffthevirtualmachineandclosetheWorkstationwindow.
2Onthemachinethathoststhevirtualmachine,addthefollowinglinetothevirtual
machineconfiguration(.vmx)fileorto~/.vmware/config:
xkeymap.keycode.<code> = "<v-scan_code>"
The<code>valuemustbeadecimalnumberand<v-scan_code>mustbea
C‐syntaxhexadecimalnumber(forexample,0x001).
Forexample,toswapleftCtrlandCapsLock,usethefollowinglines:
xkeymap.keycode.64 = "0x01d # X Caps_Lock -> VM left ctrl"
xkeymap.keycode.37 = "0x03a # X Control_L -> VM caps lock"
3 Saveandclosethefile.
X Key Codes Compared to Keysyms
PressingakeyonthePCkeyboardgeneratesaPCscancodebasedroughlyonthe
positionofthekey.Forexample,theZkeyonaGermankeyboardgeneratesthesame
codeastheYkeyonanEnglishkeyboardbecausetheyareinthesamepositiononthe
keyboard.Mostkeyshav
eone‐bytescancodes,butsomekeyshavetwo‐bytescan
codeswithprefix0xe0.
Internally,WorkstationusesasimplifiedversionofthePCscancodethatisasingle
nine‐bitnumericvalue,calledav‐scancode.Av‐scancodeiswrittenasathree‐di
git
hexadecima
lnumber.Thefirstdigitis0or1.Forexample,theCtrlkeyontheleftside
ofthekeyboardhasaone‐bytescancode(0x1d).Itsv‐scancodeis0x01d.TheCtrlkey
scancodeontherightsideofthekeyboardistwobytes(0xe0,0x1d).Itsv‐sc
ancodeis
0x11d.
AnXFree86serveronaPChasaone‐to‐onemappingfromXkeycodestoPCscan
codes,orv‐scancodes,whichiswhatWorkstationuses.WhenWorkstationishostedon
anXFree86serverandrunsalocalvirtualmachine,itus
esthebuilt‐
inmappingfromX
keycodestov‐scancodes.Thismappingiskeyboardindependentandshouldbe
correctformostlanguages.Inothercases(notanXFree86serverornotalocalserver),
Workstationmustmapkeysymstov‐scancodesbyusingasetofkeyboard‐speci
fic
tab
les.
AnXserverusesatwo‐levelencodingofkeys,whichincludestheXkeycodeandthe
keysym.AnXkeycodeisaone‐bytevalue.Theassignmentofkeycodestokeys
dependsontheXserverimplementationandthephysicalkeyboard.Asaresult,anX
appl
icationnormallycannotusekeycodesdirectly.Instead,thekeycodesaremapped
Comentários a estes Manuais