-
Notifications
You must be signed in to change notification settings - Fork 56
Open
Description
I use gohook in the project github.com/shortcut and publish it to macOS / Linux / Windows.
In macOS if I push some key and hold it will send multiple keyDown events altought I clicked only once and holding.
in Windows if I push some key without holding it send multiple keyDown events, if I hold then also same as macOS - multiple events are sent for simple hit on keys.
- Gohook version c94ab29
- Go version:
go version go1.22.0 darwin/arm64 - Gcc version:
Apple clang version 15.0.0 (clang-1500.1.0.2.5) - Operating system and bit: macOS
- Resolution:
- Can you reproduce the bug at Examples:
- Yes
func registerShortcuts(shortcuts []Shortcut) {
for _, shortcut := range shortcuts {
fmt.Printf("Register shortcut %v\n", shortcut)
hook.Register(hook.KeyDown, shortcut.Keys, func(e hook.Event) {
fmt.Printf("Shortcut <%s> activated\n", shortcut.Name)
command := strings.Split(shortcut.Command, " ")
cmd := exec.Command(command[0], command[1:]...)
if err := cmd.Start(); err != nil {
fmt.Printf("Error executing command for shortcut <%s>: %v\n", shortcut.Name, err)
}
})
}
}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels