Closed cauefcr closed 5 years ago
What do you think about adding routing support, so the library user can do something like:
hook.Pressed("/kbd/a",func(e){
fmt.Print("a was pressed")
})
The code has been tested on one platform, and will be further reviewed and tested on other platforms to merge.
Thanks, this is awesome work.
You're quite welcome, thanks for robotgo.
I added two channels to the project, a Go one and a C one (eb_chan), the C one is accessed from the dispatch_process, where the events are sent in json form, the second one is accessible to the user, is used by the pollEv function. pollEv reads from the C channel, converts the json to the Event struct and sends it to the Go channel.
The project only has two functions now: Start and End, which attaches and detaches the hook, as well as manage the global state, respectively.
(hope the PR is accepted :) )