Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 45 additions & 21 deletions bootcommand/boot_command.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions bootcommand/boot_command.pigeon
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ SpecialKey = "bs"i / "del"i / "enter"i / "esc"i / "f10"i / "f11"i / "f12"i
/ "return"i / "tab"i / "up"i / "down"i / "spacebar"i / "insert"i / "home"i
/ "end"i / "pageUp"i / "pageDown"i / "leftAlt"i / "leftCtrl"i / "leftShift"i
/ "rightAlt"i / "rightCtrl"i / "rightShift"i / "leftSuper"i / "rightSuper"i
/ "leftCommand"i / "rightCommand"i / "leftOption"i / "rightOption"i
// left/right must go last, to not take priority over {left/right}Foo
/ "left"i / "right"i / "menu"i

NonZeroDigit = [1-9]
Expand Down
6 changes: 5 additions & 1 deletion bootcommand/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,11 @@ const PackerKeyDefault = 100 * time.Millisecond
//
// - `<leftShift> <rightShift>` - Simulates pressing the shift key.
//
// - `<leftSuper> <rightSuper>` - Simulates pressing the ⌘ or Windows key.
// - `<leftSuper> <rightSuper>` - Simulates pressing the super key.
//
// - `<leftCommand> <rightCommand>` - Simulates pressing the ⌘ key.
//
// - `<leftOption> <rightOption>` - Simulates pressing the ⌥ key.
//
// - `<wait> <wait5> <wait10>` - Adds a 1, 5 or 10 second pause before
// sending any additional keys. This is useful if you have to generally
Expand Down
6 changes: 6 additions & 0 deletions bootcommand/usb_driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,12 @@ func NewUSBDriver(send SendUsbScanCodes, interval time.Duration) *usbDriver {
"leftsuper": key.CodeLeftGUI,
"rightsuper": key.CodeRightGUI,
"spacebar": key.CodeSpacebar,

// https://developer.apple.com/accessories/Accessory-Design-Guidelines.pdf
"leftcommand": key.CodeLeftGUI,
"rightcommand": key.CodeRightGUI,
"leftoption": key.CodeLeftAlt,
"rightoption": key.CodeRightAlt,
}

scancodeIndex := make(map[string]key.Code)
Expand Down
6 changes: 6 additions & 0 deletions bootcommand/vnc_driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,12 @@ func NewVNCDriver(c VNCKeyEvent, interval time.Duration) *vncDriver {
sMap["tab"] = 0xFF09
sMap["up"] = 0xFF52

// Verified against the built-in VNC server on macOS
sMap["leftcommand"] = 0xFFE9
sMap["rightcommand"] = 0xFFEA
sMap["leftoption"] = 0xFFE7
sMap["rightoption"] = 0xFFE8

return &vncDriver{
c: c,
interval: keyInterval,
Expand Down