robotgo
robotgo copied to clipboard
hook keycode event error
when i touch the enter key on keyboard, the event is 2021-04-19 15:33:10.457 +0800 CST m=+65.499394961 - Event: {Kind: KeyDown, Rawcode: 36, Keychar: 13}
ctrl, shift and opt are not working fine.
My code is
evChan := robotgo.EventStart()
defer robotgo.EventEnd()
for ev := range evChan {
if ev.Kind == hook.KeyDown {
fmt.Println("evt: ", ev)
//fmt.Println("pressed: ", hook.RawcodetoKeychar(ev.Rawcode))
}
}
pls use ev.Keycode
,then you can look it in hook.Keycode