mirror of
https://github.com/go-vgo/robotgo
synced 2026-05-24 10:19:01 +00:00
add gohook modern and concurrent API
This commit is contained in:
parent
67bbac75ce
commit
961f9eedc6
1 changed files with 22 additions and 0 deletions
22
hook.go
22
hook.go
|
|
@ -25,6 +25,28 @@ import (
|
|||
|_______| \__/ |_______||__| \__| |__|
|
||||
*/
|
||||
|
||||
// EventStart start global event hook
|
||||
// return event channel
|
||||
func EventStart() chan hook.Event {
|
||||
return hook.Start()
|
||||
}
|
||||
|
||||
// EventEnd removes global event hook
|
||||
func EventEnd() {
|
||||
hook.End()
|
||||
}
|
||||
|
||||
// EventProcess return go hook process
|
||||
func EventProcess(Events chan hook.Event) chan bool {
|
||||
return hook.Process(Events)
|
||||
}
|
||||
|
||||
// EventHook register gohook event
|
||||
func EventHook(When uint8, keysPressed []string, Callback func(hook.Event)) {
|
||||
hook.Register(When, keysPressed, Callback)
|
||||
return
|
||||
}
|
||||
|
||||
// AddEvent add event listener,
|
||||
//
|
||||
// parameters for the string type,
|
||||
|
|
|
|||
Loading…
Reference in a new issue