robotgo icon indicating copy to clipboard operation
robotgo copied to clipboard

hook keycode event error

Open bobwong89757 opened this issue 3 years ago • 1 comments

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))
  }

}

bobwong89757 avatar Apr 19 '21 07:04 bobwong89757

pls use ev.Keycode,then you can look it in hook.Keycode

labulakalia avatar Oct 05 '21 05:10 labulakalia