From 4acc98a729e2545cb7285fbf262f6268ac162b25 Mon Sep 17 00:00:00 2001 From: Andrew Pennebaker Date: Thu, 7 Dec 2017 23:15:56 -0600 Subject: [PATCH] add super key (vmware builder) --- .../vmware/common/step_type_boot_command.go | 46 +++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/builder/vmware/common/step_type_boot_command.go b/builder/vmware/common/step_type_boot_command.go index 28db3c72e..b100b609e 100644 --- a/builder/vmware/common/step_type_boot_command.go +++ b/builder/vmware/common/step_type_boot_command.go @@ -183,6 +183,8 @@ func vncSendString(c *vnc.ClientConn, original string) { special[""] = 0xFFEA special[""] = 0xFFE4 special[""] = 0xFFE2 + special[""] = 0xFFEB + special[""] = 0xFFEC shiftedChars := "~!@#$%^&*()_+{}|:\"<>?" @@ -231,6 +233,17 @@ func vncSendString(c *vnc.ClientConn, original string) { continue } + if strings.HasPrefix(original, "") { + keyCode = special[""] + original = original[len(""):] + log.Printf("Special code '' found, replacing with: %d", keyCode) + + c.KeyEvent(keyCode, true) + time.Sleep(keyInterval) + + continue + } + if strings.HasPrefix(original, "") { keyCode = special[""] original = original[len(""):] @@ -264,6 +277,17 @@ func vncSendString(c *vnc.ClientConn, original string) { continue } + if strings.HasPrefix(original, "") { + keyCode = special[""] + original = original[len(""):] + log.Printf("Special code '' found, replacing with: %d", keyCode) + + c.KeyEvent(keyCode, false) + time.Sleep(keyInterval) + + continue + } + if strings.HasPrefix(original, "") { keyCode = special[""] original = original[len(""):] @@ -297,6 +321,17 @@ func vncSendString(c *vnc.ClientConn, original string) { continue } + if strings.HasPrefix(original, "") { + keyCode = special[""] + original = original[len(""):] + log.Printf("Special code '' found, replacing with: %d", keyCode) + + c.KeyEvent(keyCode, true) + time.Sleep(keyInterval) + + continue + } + if strings.HasPrefix(original, "") { keyCode = special[""] original = original[len(""):] @@ -330,6 +365,17 @@ func vncSendString(c *vnc.ClientConn, original string) { continue } + if strings.HasPrefix(original, "") { + keyCode = special[""] + original = original[len(""):] + log.Printf("Special code '' found, replacing with: %d", keyCode) + + c.KeyEvent(keyCode, false) + time.Sleep(keyInterval) + + continue + } + if strings.HasPrefix(original, "") { log.Printf("Special code '' found, sleeping one second") time.Sleep(1 * time.Second)