Skip to content

Commit

Permalink
Fix menu boot command vnc key stroke (#184)
Browse files Browse the repository at this point in the history
* boot_command: add menu special key

* Add menu special key

* Add menu special key

* vnc_driver: test menu key

* vnc_driver: test menu key

* Fix formatting generated with 1.20.3
  • Loading branch information
korli authored May 25, 2023
1 parent 8331daf commit 7c81952
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 22 deletions.
44 changes: 25 additions & 19 deletions bootcommand/boot_command.go

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

2 changes: 1 addition & 1 deletion bootcommand/boot_command.pigeon
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ 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
/ "left"i / "right"i
/ "left"i / "right"i / "menu"i

NonZeroDigit = [1-9]
Digit = [0-9]
Expand Down
3 changes: 2 additions & 1 deletion bootcommand/boot_command_ast_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ func Test_parse(t *testing.T) {
in := "<wait><wait20><wait3s><wait4m2ns>"
in += "foo/bar > one 界"
in += "<fon> b<fOff>"
in += "<foo><f3><f12><spacebar><leftalt><rightshift><rightsuper>"
in += "<foo><f3><f12><spacebar><leftalt><rightshift><rightsuper><menu>"
expected := []string{
"Wait<1s>",
"Wait<20s>",
Expand Down Expand Up @@ -51,6 +51,7 @@ func Test_parse(t *testing.T) {
"Spec-Press(leftalt)",
"Spec-Press(rightshift)",
"Spec-Press(rightsuper)",
"Spec-Press(menu)",
}

seq, err := GenerateExpressionSequence(in)
Expand Down
4 changes: 3 additions & 1 deletion bootcommand/vnc_driver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,14 @@ func (s *sender) KeyEvent(u uint32, down bool) error {
}

func Test_vncSpecialLookup(t *testing.T) {
in := "<rightShift><rightshiftoff><RIGHTSHIFTON>"
in := "<rightShift><rightshiftoff><RIGHTSHIFTON><menu>"
expected := []event{
{0xFFE2, true},
{0xFFE2, false},
{0xFFE2, false},
{0xFFE2, true},
{0xFF67, true},
{0xFF67, false},
}
s := &sender{}
d := NewVNCDriver(s, time.Duration(0))
Expand Down

0 comments on commit 7c81952

Please sign in to comment.