gohook
gohook copied to clipboard
GoHook, Go global keyboard and mouse listener hook
``` env CC=x86_64-w64-mingw32-gcc GOOS=windows go mod=vendor build main.go ``` Hello im trying to compile a program to windows but its giving me this error 
Hi, i'm on linux and when i run the following command `GOOS=windows go test -c` in this repository i go these errors: ``` # github.com/robotn/gohook [github.com/robotn/gohook.test] ./hook_test.go:13:7: undefined: Start ./hook_test.go:18:7:...
(Windows 11) When you hold a mouse button (left == 1 for instance) and move the mouse events look like this: ``` hook: 0 2022-02-06 01:01:06.8846335 -0800 PST m=+9.886081101 -...
I see some confusion or errors when listen keyboard on win10 Code: ``` package main import ( "fmt" hook "github.com/robotn/gohook" ) func main() { kind := map[uint8]string{3: "KeyDown", 4: "KeyHold",...
env: GOVERSION="go1.17.6" OS: Mac OS press the key there is no print in the console
Fixes #32 (verified on Windows 11)
Using the code examples, having the following code ```go hook.Register(hook.KeyDown, []string{"w"}, func(e hook.Event) { fmt.Println("w-") run=false }) hook.Register(hook.KeyHold, []string{"space"}, func(e hook.Event) { ww run=true }) hook.Register(hook.KeyUp, []string{"space"}, func(e hook.Event) {...
Registering F12 triggers every function key (f1 to f12)
Cannot compile on Fedora Workstation 34, which uses Wayland. It looks like it's requiring headers from the X11 subsystem: ``` $ go get -v github.com/robotn/gohook go: downloading github.com/robotn/gohook v0.30.5 github.com/robotn/gohook...
``` hook.Register(hook.MouseDown, []string{}, func(e hook.Event) { log.Println("mouse down:",e.Button,hook.MouseMap["right"]) }) ``` Click mouse right key on Windows and MacOS display e.button is 2, ubuntu20.04 is 3