From e4cfcb2a8ada6ad82aaf3f784a9651d8cb7697d1 Mon Sep 17 00:00:00 2001 From: Myles Steinhauser Date: Fri, 10 Jan 2014 12:40:43 -0500 Subject: [PATCH 1/2] Add more special scancodes --- builder/qemu/step_type_boot_command.go | 11 +++++++++++ builder/virtualbox/iso/step_type_boot_command.go | 10 ++++++++++ builder/vmware/iso/step_type_boot_command.go | 11 +++++++++++ 3 files changed, 32 insertions(+) diff --git a/builder/qemu/step_type_boot_command.go b/builder/qemu/step_type_boot_command.go index 3b2dd62ad..9bf195669 100644 --- a/builder/qemu/step_type_boot_command.go +++ b/builder/qemu/step_type_boot_command.go @@ -92,6 +92,7 @@ func (s *stepTypeBootCommand) Run(state multistep.StateBag) multistep.StepAction func (*stepTypeBootCommand) Cleanup(multistep.StateBag) {} func vncSendString(c *vnc.ClientConn, original string) { + // Scancodes reference: https://github.com/qemu/qemu/blob/master/ui/vnc_keysym.h special := make(map[string]uint32) special[""] = 0xFF08 special[""] = 0xFFFF @@ -111,6 +112,16 @@ func vncSendString(c *vnc.ClientConn, original string) { special[""] = 0xFFC9 special[""] = 0xFF0D special[""] = 0xFF09 + special[""] = 0xFF52 + special[""] = 0xFF54 + special[""] = 0xFF51 + special[""] = 0xFF53 + special[""] = 0x020 + special[""] = 0xFF63 + special[""] = 0xFF50 + special[""] = 0xFF57 + special[""] = 0xFF55 + special[""] = 0xFF56 shiftedChars := "~!@#$%^&*()_+{}|:\"<>?" diff --git a/builder/virtualbox/iso/step_type_boot_command.go b/builder/virtualbox/iso/step_type_boot_command.go index d479b84e0..e6e06b4ac 100644 --- a/builder/virtualbox/iso/step_type_boot_command.go +++ b/builder/virtualbox/iso/step_type_boot_command.go @@ -118,6 +118,16 @@ func scancodes(message string) []string { special[""] = []string{"44", "c4"} special[""] = []string{"1c", "9c"} special[""] = []string{"0f", "8f"} + special[""] = []string{"48", "c8"} + special[""] = []string{"50", "d0"} + special[""] = []string{"4b", "cb"} + special[""] = []string{"4d", "cd"} + special[""] = []string{"39", "b9"} + special[""] = []string{"52", "d2"} + special[""] = []string{"47", "c7"} + special[""] = []string{"4f", "cf"} + special[""] = []string{"49", "c9"} + special[""] = []string{"51", "d1"} shiftedChars := "~!@#$%^&*()_+{}|:\"<>?" diff --git a/builder/vmware/iso/step_type_boot_command.go b/builder/vmware/iso/step_type_boot_command.go index 89e7ac432..581f8003e 100644 --- a/builder/vmware/iso/step_type_boot_command.go +++ b/builder/vmware/iso/step_type_boot_command.go @@ -116,6 +116,7 @@ func (s *stepTypeBootCommand) Run(state multistep.StateBag) multistep.StepAction func (*stepTypeBootCommand) Cleanup(multistep.StateBag) {} func vncSendString(c *vnc.ClientConn, original string) { + // Scancodes reference: https://github.com/qemu/qemu/blob/master/ui/vnc_keysym.h special := make(map[string]uint32) special[""] = 0xFF08 special[""] = 0xFFFF @@ -135,6 +136,16 @@ func vncSendString(c *vnc.ClientConn, original string) { special[""] = 0xFFC9 special[""] = 0xFF0D special[""] = 0xFF09 + special[""] = 0xFF52 + special[""] = 0xFF54 + special[""] = 0xFF51 + special[""] = 0xFF53 + special[""] = 0x020 + special[""] = 0xFF63 + special[""] = 0xFF50 + special[""] = 0xFF57 + special[""] = 0xFF55 + special[""] = 0xFF56 shiftedChars := "~!@#$%^&*()_+{}|:\"<>?" From 28286d2821f7528b56afd75130ceedb6eaca6033 Mon Sep 17 00:00:00 2001 From: Myles Steinhauser Date: Mon, 13 Jan 2014 00:03:10 -0500 Subject: [PATCH 2/2] Fix tabs vs spaces --- builder/qemu/step_type_boot_command.go | 24 +++++++++---------- .../virtualbox/iso/step_type_boot_command.go | 24 +++++++++---------- builder/vmware/iso/step_type_boot_command.go | 24 +++++++++---------- 3 files changed, 36 insertions(+), 36 deletions(-) diff --git a/builder/qemu/step_type_boot_command.go b/builder/qemu/step_type_boot_command.go index 9bf195669..5fdc90ca3 100644 --- a/builder/qemu/step_type_boot_command.go +++ b/builder/qemu/step_type_boot_command.go @@ -16,9 +16,9 @@ import ( const KeyLeftShift uint32 = 0xFFE1 type bootCommandTemplateData struct { - HTTPIP string + HTTPIP string HTTPPort uint - Name string + Name string } // This step "types" the boot command into the VM over VNC. @@ -112,16 +112,16 @@ func vncSendString(c *vnc.ClientConn, original string) { special[""] = 0xFFC9 special[""] = 0xFF0D special[""] = 0xFF09 - special[""] = 0xFF52 - special[""] = 0xFF54 - special[""] = 0xFF51 - special[""] = 0xFF53 - special[""] = 0x020 - special[""] = 0xFF63 - special[""] = 0xFF50 - special[""] = 0xFF57 - special[""] = 0xFF55 - special[""] = 0xFF56 + special[""] = 0xFF52 + special[""] = 0xFF54 + special[""] = 0xFF51 + special[""] = 0xFF53 + special[""] = 0x020 + special[""] = 0xFF63 + special[""] = 0xFF50 + special[""] = 0xFF57 + special[""] = 0xFF55 + special[""] = 0xFF56 shiftedChars := "~!@#$%^&*()_+{}|:\"<>?" diff --git a/builder/virtualbox/iso/step_type_boot_command.go b/builder/virtualbox/iso/step_type_boot_command.go index e6e06b4ac..e5f90b36d 100644 --- a/builder/virtualbox/iso/step_type_boot_command.go +++ b/builder/virtualbox/iso/step_type_boot_command.go @@ -15,9 +15,9 @@ import ( const KeyLeftShift uint32 = 0xFFE1 type bootCommandTemplateData struct { - HTTPIP string + HTTPIP string HTTPPort uint - Name string + Name string } // This step "types" the boot command into the VM over VNC. @@ -118,16 +118,16 @@ func scancodes(message string) []string { special[""] = []string{"44", "c4"} special[""] = []string{"1c", "9c"} special[""] = []string{"0f", "8f"} - special[""] = []string{"48", "c8"} - special[""] = []string{"50", "d0"} - special[""] = []string{"4b", "cb"} - special[""] = []string{"4d", "cd"} - special[""] = []string{"39", "b9"} - special[""] = []string{"52", "d2"} - special[""] = []string{"47", "c7"} - special[""] = []string{"4f", "cf"} - special[""] = []string{"49", "c9"} - special[""] = []string{"51", "d1"} + special[""] = []string{"48", "c8"} + special[""] = []string{"50", "d0"} + special[""] = []string{"4b", "cb"} + special[""] = []string{"4d", "cd"} + special[""] = []string{"39", "b9"} + special[""] = []string{"52", "d2"} + special[""] = []string{"47", "c7"} + special[""] = []string{"4f", "cf"} + special[""] = []string{"49", "c9"} + special[""] = []string{"51", "d1"} shiftedChars := "~!@#$%^&*()_+{}|:\"<>?" diff --git a/builder/vmware/iso/step_type_boot_command.go b/builder/vmware/iso/step_type_boot_command.go index 581f8003e..d021d5d58 100644 --- a/builder/vmware/iso/step_type_boot_command.go +++ b/builder/vmware/iso/step_type_boot_command.go @@ -18,9 +18,9 @@ import ( const KeyLeftShift uint32 = 0xFFE1 type bootCommandTemplateData struct { - HTTPIP string + HTTPIP string HTTPPort uint - Name string + Name string } // This step "types" the boot command into the VM over VNC. @@ -136,16 +136,16 @@ func vncSendString(c *vnc.ClientConn, original string) { special[""] = 0xFFC9 special[""] = 0xFF0D special[""] = 0xFF09 - special[""] = 0xFF52 - special[""] = 0xFF54 - special[""] = 0xFF51 - special[""] = 0xFF53 - special[""] = 0x020 - special[""] = 0xFF63 - special[""] = 0xFF50 - special[""] = 0xFF57 - special[""] = 0xFF55 - special[""] = 0xFF56 + special[""] = 0xFF52 + special[""] = 0xFF54 + special[""] = 0xFF51 + special[""] = 0xFF53 + special[""] = 0x020 + special[""] = 0xFF63 + special[""] = 0xFF50 + special[""] = 0xFF57 + special[""] = 0xFF55 + special[""] = 0xFF56 shiftedChars := "~!@#$%^&*()_+{}|:\"<>?"