decided to fork forever

This commit is contained in:
caue 2020-03-28 21:52:17 -03:00
parent d5e965f25c
commit 35fdcff3ec
2 changed files with 14 additions and 15 deletions

View File

@ -1,9 +1,9 @@
# gohook # ghook (gohook fork)
[![CircleCI Status](https://circleci.com/gh/cauefcr/gohook.svg?style=shield)](https://circleci.com/gh/cauefcr/gohook) [![CircleCI Status](https://circleci.com/gh/cauefcr/ghook.svg?style=shield)](https://circleci.com/gh/cauefcr/ghook)
![Appveyor](https://ci.appveyor.com/api/projects/status/github/cauefcr/gohook?branch=master&svg=true) ![Appveyor](https://ci.appveyor.com/api/projects/status/github/cauefcr/ghook?branch=master&svg=true)
[![Go Report Card](https://goreportcard.com/badge/github.com/cauefcr/gohook)](https://goreportcard.com/report/github.com/cauefcr/gohook) [![Go Report Card](https://goreportcard.com/badge/github.com/cauefcr/ghook)](https://goreportcard.com/report/github.com/cauefcr/ghook)
[![GoDoc](https://godoc.org/github.com/cauefcr/gohook?status.svg)](https://godoc.org/github.com/cauefcr/gohook) [![GoDoc](https://godoc.org/github.com/cauefcr/ghook?status.svg)](https://godoc.org/github.com/cauefcr/ghook)
<!-- This is a work in progress. --> <!-- This is a work in progress. -->
Based on [libuiohook](https://github.com/kwhat/libuiohook) Based on [libuiohook](https://github.com/kwhat/libuiohook)
@ -14,7 +14,7 @@ package main
import ( import (
"fmt" "fmt"
//"github.com/robotn/gohook" //"github.com/robotn/gohook"
"github.com/cauefcr/gohook" "github.com/cauefcr/ghook"
) )
func main() { func main() {

17
hook.go
View File

@ -29,8 +29,7 @@ import (
"time" "time"
"unsafe" "unsafe"
) )
onst (
const (
HookEnabled = 1 //iota HookEnabled = 1 //iota
HookDisabled = 2 HookDisabled = 2
KeyDown = 3 KeyDown = 3
@ -292,12 +291,12 @@ func End() {
} }
// AddEvent add event listener // AddEvent add event listener
func AddEvent(key string) int { // func AddEvent(key string) int {
cs := C.CString(key) // cs := C.CString(key)
defer C.free(unsafe.Pointer(cs)) // defer C.free(unsafe.Pointer(cs))
eve := C.add_event(cs) // eve := C.add_event(cs)
geve := int(eve) // geve := int(eve)
return geve // return geve
} // }