mirror of
https://github.com/hashicorp/packer.git
synced 2026-09-20 06:51:39 -04:00
remove duplicated press
This commit is contained in:
@@ -10,6 +10,7 @@ import (
|
||||
"github.com/hashicorp/packer/template/interpolate"
|
||||
"github.com/vmware/govmomi/vim25/types"
|
||||
"golang.org/x/mobile/event/key"
|
||||
"log"
|
||||
"time"
|
||||
)
|
||||
|
||||
@@ -91,11 +92,11 @@ func (s *StepBootCommand) Run(ctx context.Context, state multistep.StateBag) mul
|
||||
case key.CodeLeftControl:
|
||||
// <leftCtrlOn>
|
||||
keyCtrl = downs[i]
|
||||
case key.CodeLeftShift:
|
||||
// <leftShiftOn>
|
||||
default:
|
||||
keyShift = downs[i]
|
||||
}
|
||||
|
||||
log.Printf("Sending code %s, shift %v", code, downs[i])
|
||||
spec.KeyEvents = append(spec.KeyEvents, types.UsbScanCodeSpecKeyEvent{
|
||||
UsbHidCode: int32(code)<<16 | 7,
|
||||
Modifiers: &types.UsbScanCodeSpecModifierType{
|
||||
|
||||
@@ -26,7 +26,6 @@ func TestStepBootCommand_Run(t *testing.T) {
|
||||
Config: &BootConfig{
|
||||
BootConfig: bootcommand.BootConfig{
|
||||
BootCommand: []string{
|
||||
" initrd=/install/initrd.gz",
|
||||
"<leftShiftOn><enter><wait><f6><wait><esc><wait>",
|
||||
"<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
|
||||
"<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
|
||||
|
||||
Reference in New Issue
Block a user