2.0

Table Of Contents
VMware, Inc. 185
Chapter 8 Configuring Virtual Machine Hardware
X Key Codes Compared to Keysyms
PressingakeyonthePCkeyboardgeneratesascancodebasedroughlyontheposition
ofthekey.Forexample,theZkeyonaGermankeyboardgeneratesthesamecodeas
theYkeyonanEnglishkeyboard,becausetheyareinthesamepositiononthe
keyboard.Most
keyshaveonebytescancodes,butsomekeyshavetwobytescan
codeswithprefix0xe0.
Internally,VMwareServerusesasimplifiedversionofthePCscancodethat isasingle
ninebitnumericvalue,calledavscancode.Avscancodeiswrittenasathree
digit
hexadecimalnumber.Thefirstdigitis0or1.Forexample,thelefthandCtrlkeyhasa
onebytescancode(0x1d);itsvscancodeis0x01d.TherighthandCtrlkeyscancode
istwobytes(0xe0,0x1d);itsvscancodeis0x11d.
AnX
serverusesatwolevelencodingofkeys.AnXkeycodeisaonebytevalue.The
assignmentofkeycodestokeysdependsontheXserverimplementationandthe
physicalkeyboard.Asaresult,anXapplicationcannotusekeycodesdirectly.Instead,
thekeycodesaremapped
intokeysymsthathavenameslikespace,escape,x,and2.
ThemappingcanbecontrolledbyanXapplicationusingthe
XChangeKeyboardMapping functionorthexmodmapprogram.Youcanusexevtoview
thekeycodesandkeysymsforkeystypedintoitswindow.
Akeycodecorrespondsroughlyto
aphysicalkey,whileakeysymcorrespondstothe
symbolonthekeytop.Forexample,withanXFree86serverrunningonaPC,theZkey
ontheGermankeyboardhasthesamekeycodeastheYkeyonanEnglishkeyboard.
TheGermanZkeysym,however,is
thesameastheEnglishZkeysym,anddifferent
fromtheEnglishYkeysym.
ForanXFree86serveronaPC,thereisaonetoonemappingfromXkeycodestoPC
scancodes(orvscancodes,whichiswhatVMwareServerreallyuses).VMwareServer
takesadvantage
ofthisfact.WhenitisusinganXFree86serveronthelocalhost,ituses
thebuiltinmappingfromXkeycodestovscancodes.Thismappingiskeyboard
independentandiscorrectformost,ifnotall,languages.Whenyouarenotusingan
XFree86serveror
alocalserver,VMwareServermustmapkeysymstovscancodesby
usingasetofkeyboardspecifictables.