Open
Description
- Please speak English (English only), this is the language everybody of us can speak and write.
- Please take a moment to search that an issue doesn't already exist.
- Please make sure
Golang, GCC
is installed correctly before installing RobotGo.
- Please give all relevant information below for bug reports, incomplete details will be handled as an invalid report.
You MUST delete the content above including this line before posting, otherwise your issue will be invalid.
- Robotgo version (or commit ref):
- Go version: 1.21.5
- Gcc version: -
- Operating system and bit: macOS Sonoma 14.5
- Resolution:
- Can you reproduce the bug at Examples:
- Yes (provide example code)
- No
- Not relevant
- Provide example code:
package main
import (
"fmt"
// "github.com/go-vgo/robotgo"
hook "github.com/robotn/gohook"
)
func main() {
add()
low()
event()
}
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")
hook.End()
})
fmt.Println("--- Please press capslock---")
hook.Register(hook.KeyDown, []string{"capslock"}, func(e hook.Event) {
fmt.Println("capslock")
})
s := hook.Start()
<-hook.Process(s)
}
func low() {
evChan := hook.Start()
defer hook.End()
for ev := range evChan {
fmt.Println("hook: ", ev)
}
}
func event() {
ok := hook.AddEvents("q", "ctrl", "shift")
if ok {
fmt.Println("add events...")
}
keve := hook.AddEvent("k")
if keve {
fmt.Println("you press... ", "k")
}
mleft := hook.AddEvent("mleft")
if mleft {
fmt.Println("you press... ", "mouse left button")
}
}
- Log gist:
Description
Nothing happens after pressing capslock
Metadata
Metadata
Assignees
Labels
No labels