Fixing issue with kb

This commit is contained in:
Kenneth Shaw 2018-07-10 19:51:58 +07:00
parent db9a873141
commit 0406fa8a8a

View File

@ -5,6 +5,7 @@ package kb
//go:generate go run gen.go -out keys.go -pkg kb
import (
"runtime"
"unicode"
"github.com/chromedp/cdproto/input"
@ -97,6 +98,9 @@ func Encode(r rune) []*input.DispatchKeyEventParams {
NativeVirtualKeyCode: v.Native,
WindowsVirtualKeyCode: v.Windows,
}
if runtime.GOOS == "darwin" {
keyDown.NativeVirtualKeyCode = 0
}
if v.Shift {
keyDown.Modifiers |= input.ModifierShift
}