mirror of
https://github.com/robotn/gohook.git
synced 2025-04-27 22:49:42 +08:00
bugfixing
This commit is contained in:
parent
9f960b4d26
commit
e047a93060
4
go.mod
4
go.mod
@ -1 +1,3 @@
|
|||||||
module github.com/cauefcr/ghook
|
module github.com/cauefcr/ghook
|
||||||
|
|
||||||
|
go 1.14
|
||||||
|
2
hook.go
2
hook.go
@ -265,6 +265,7 @@ func KeychartoRawcode(kc string) uint16 {
|
|||||||
// returns event channel
|
// returns event channel
|
||||||
func Start() chan Event {
|
func Start() chan Event {
|
||||||
asyncon = true
|
asyncon = true
|
||||||
|
ev = make(chan Event, 1024)
|
||||||
go C.startev()
|
go C.startev()
|
||||||
go func() {
|
go func() {
|
||||||
for {
|
for {
|
||||||
@ -286,6 +287,7 @@ func End() {
|
|||||||
for len(ev) != 0 {
|
for len(ev) != 0 {
|
||||||
<-ev
|
<-ev
|
||||||
}
|
}
|
||||||
|
close(ev)
|
||||||
asyncon = false
|
asyncon = false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user