Gcc version: gcc version 12.2.0 (Rev6, Built by MSYS2 project)
Operating system and bit: windows 64bit
based on the example code at event part, just add 2 lines of robotgo.TypeStr("Hi galaxy, hi stars, hi MT.Rainier, hi sea. こんにちは世界.") as the following in function add, the full code of function add is
func add() {
fmt.Println("--- !! Please press ctrl + shift + q to stop hook ---")
hook.Register(hook.KeyDown, []string{"q", "ctrl", "shift"}, func(e hook.Event) {
fmt.Println("ctrl-shift-q")
robotgo.TypeStr("Hi galaxy, hi stars, hi MT.Rainier, hi sea. こんにちは世界.") // the first line added
// press "ctrl + shift + q" then:
hook.End()
})
fmt.Println("--- Please press w---")
hook.Register(hook.KeyDown, []string{"w"}, func(e hook.Event) {
fmt.Println("w")
robotgo.TypeStr("Hi galaxy, hi stars, hi MT.Rainier, hi sea. こんにちは世界.") // the second line added
// press "w" at first:
})
s := hook.Start()
<-hook.Process(s)
}
it's ok for pressing the keyboard "w", but not ok for press "ctrl + shift + q", as the following screenshot: the front part of that string "Hi galaxy, hi stars, hi MT.Rainier, hi sea. " has gone away:
based on the example code at event part, just add 2 lines of robotgo.TypeStr("Hi galaxy, hi stars, hi MT.Rainier, hi sea. こんにちは世界.") as the following in function add, the full code of function add is
it's ok for pressing the keyboard "w", but not ok for press "ctrl + shift + q", as the following screenshot: the front part of that string "Hi galaxy, hi stars, hi MT.Rainier, hi sea. " has gone away: