From 4c1fbfdd61dcf0cf8a1aadaca5513827ebb9dc06 Mon Sep 17 00:00:00 2001 From: Calle Pettersson Date: Thu, 14 Mar 2019 22:26:55 +0100 Subject: [PATCH] Shifted special runes are already handled, simplify SendKey --- builder/proxmox/bootcommand_driver.go | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/builder/proxmox/bootcommand_driver.go b/builder/proxmox/bootcommand_driver.go index 4eeb48f5f..1570845fe 100644 --- a/builder/proxmox/bootcommand_driver.go +++ b/builder/proxmox/bootcommand_driver.go @@ -2,7 +2,6 @@ package proxmox import ( "fmt" - "strings" "time" "unicode" @@ -83,14 +82,9 @@ func (p *proxmoxDriver) SendKey(key rune, action bootcommand.KeyAction) error { return p.send(special) } - const shiftFormat = "shift-%c" - const shiftedChars = "~!@#$%^&*()_+{}|:\"<>?" // Copied from bootcommand/driver.go - - keyShift := unicode.IsUpper(key) || strings.ContainsRune(shiftedChars, key) - var keys string - if keyShift { - keys = fmt.Sprintf(shiftFormat, unicode.ToLower(key)) + if unicode.IsUpper(key) { + keys = fmt.Sprintf("shift-%c", unicode.ToLower(key)) } else { keys = fmt.Sprintf("%c", key) }