diff --git a/builder/virtualbox/step_type_boot_command.go b/builder/virtualbox/step_type_boot_command.go index 60c897ea9..e5fb442ea 100644 --- a/builder/virtualbox/step_type_boot_command.go +++ b/builder/virtualbox/step_type_boot_command.go @@ -92,29 +92,34 @@ func (s *stepTypeBootCommand) Run(state multistep.StateBag) multistep.StepAction func (*stepTypeBootCommand) Cleanup(multistep.StateBag) {} func scancodes(message string) []string { + // Scancodes reference: http://www.win.tue.nl/~aeb/linux/kbd/scancodes-1.html + // + // Scancodes represent raw keyboard output and are fed to the VM by the + // VBoxManage controlvm keyboardputscancode program. + // + // Scancodes are recorded here in pairs. The first entry represents + // the key press and the second entry represents the key release and is + // derived from the first by the addition of 0x81. special := make(map[string][]string) - special[""] = []string{"ff", "08"} - special[""] = []string{"ff", "ff"} + special[""] = []string{"0e", "8e"} + special[""] = []string{"53", "d3"} special[""] = []string{"1c", "9c"} special[""] = []string{"01", "81"} - special[""] = []string{"ff", "be"} - special[""] = []string{"ff", "bf"} - special[""] = []string{"ff", "c0"} - special[""] = []string{"ff", "c1"} - special[""] = []string{"ff", "c2"} - special[""] = []string{"ff", "c3"} - special[""] = []string{"ff", "c4"} - special[""] = []string{"ff", "c5"} - special[""] = []string{"ff", "c6"} - special[""] = []string{"ff", "c7"} - special[""] = []string{"ff", "c8"} - special[""] = []string{"ff", "c9"} + special[""] = []string{"3b", "bb"} + special[""] = []string{"3c", "bc"} + special[""] = []string{"3d", "bd"} + special[""] = []string{"3e", "be"} + special[""] = []string{"3f", "bf"} + special[""] = []string{"40", "c0"} + special[""] = []string{"41", "c1"} + special[""] = []string{"42", "c2"} + special[""] = []string{"43", "c3"} + special[""] = []string{"44", "c4"} special[""] = []string{"1c", "9c"} special[""] = []string{"0f", "8f"} shiftedChars := "~!@#$%^&*()_+{}|:\"<>?" - // Scancodes reference: http://www.win.tue.nl/~aeb/linux/kbd/scancodes-1.html scancodeIndex := make(map[string]uint) scancodeIndex["1234567890-="] = 0x02 scancodeIndex["!@#$%^&*()_+"] = 0x02