-
Notifications
You must be signed in to change notification settings - Fork 59
Add bootcommand mappings for left/right command and option keys #293
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -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. | ||||||||||||||||||||||
|
Comment on lines
+69
to
+71
|
||||||||||||||||||||||
| // - `<leftCommand> <rightCommand>` - Simulates pressing the ⌘ key. | |
| // | |
| // - `<leftOption> <rightOption>` - Simulates pressing the ⌥ key. | |
| // - `<leftCommand> <rightCommand>` - Simulates pressing the ⌘ key. Supported | |
| // only by certain keyboard drivers (such as VNC/USB), and not by all | |
| // builders (for example, the legacy PC-XT driver). | |
| // | |
| // - `<leftOption> <rightOption>` - Simulates pressing the ⌥ key. Supported | |
| // only by certain keyboard drivers (such as VNC/USB), and not by all | |
| // builders (for example, the legacy PC-XT driver). |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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, | ||
| } | ||
|
Comment on lines
+77
to
82
|
||
|
|
||
| scancodeIndex := make(map[string]key.Code) | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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 | ||
|
Comment on lines
+81
to
+85
|
||
|
|
||
| return &vncDriver{ | ||
| c: c, | ||
| interval: keyInterval, | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The grammar now accepts
<leftCommand>,<rightCommand>,<leftOption>, and<rightOption>, but the PC-XT driver (pc_xt_driver.go) does not map these specials. This means templates using these keys will parse successfully but fail at runtime with “special … not found” when the PC-XT driver is used. Consider adding aliases in the PC-XT driver (e.g., command -> left/right super (GUI), option -> left/right alt) or restrict/qualify these tokens to drivers that support them.