mirror of
https://github.com/robotn/gohook.git
synced 2025-01-18 13:46:41 +08:00
update and optimize hook code
This commit is contained in:
parent
a1db03bfdb
commit
80a5bf3c7e
8
hook.go
8
hook.go
@ -102,9 +102,7 @@ var (
|
||||
func allPressed(pressed map[uint16]bool, keys ...uint16) bool {
|
||||
for _, i := range keys {
|
||||
// fmt.Println(i)
|
||||
if pressed[i] == false {
|
||||
return false
|
||||
}
|
||||
return !pressed[i]
|
||||
}
|
||||
|
||||
return true
|
||||
@ -123,7 +121,7 @@ func Register(when uint8, cmds []string, cb func(Event)) {
|
||||
keys[key] = tmp
|
||||
cbs[key] = cb
|
||||
events[when] = append(events[when], key)
|
||||
return
|
||||
// return
|
||||
}
|
||||
|
||||
// Process return go hook process
|
||||
@ -152,7 +150,7 @@ func Process(EvChan <-chan Event) (out chan bool) {
|
||||
out <- true
|
||||
}()
|
||||
|
||||
return out
|
||||
return
|
||||
}
|
||||
|
||||
// String return hook kind string
|
||||
|
Loading…
Reference in New Issue
Block a user