mirror of
https://github.com/robotn/gohook.git
synced 2024-11-22 02:56:54 +08:00
update parameter name and version
This commit is contained in:
parent
9d1ddf164b
commit
b3a746d8c4
7
hook.go
7
hook.go
@ -32,7 +32,7 @@ import (
|
|||||||
|
|
||||||
const (
|
const (
|
||||||
// Version get the gohook version
|
// Version get the gohook version
|
||||||
Version = "v0.30.2.88, Sierra Nevada!"
|
Version = "v0.30.4.100, Sierra Nevada!"
|
||||||
|
|
||||||
// HookEnabled honk enable status
|
// HookEnabled honk enable status
|
||||||
HookEnabled = 1 // iota
|
HookEnabled = 1 // iota
|
||||||
@ -50,6 +50,7 @@ const (
|
|||||||
MouseWheel = 11
|
MouseWheel = 11
|
||||||
|
|
||||||
FakeEvent = 12
|
FakeEvent = 12
|
||||||
|
|
||||||
// Keychar could be v
|
// Keychar could be v
|
||||||
CharUndefined = 0xFFFF
|
CharUndefined = 0xFFFF
|
||||||
WheelUp = -1
|
WheelUp = -1
|
||||||
@ -127,10 +128,10 @@ func Register(when uint8, cmds []string, cb func(Event)) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Process return go hook process
|
// Process return go hook process
|
||||||
func Process(EvChan <-chan Event) (out chan bool) {
|
func Process(evChan <-chan Event) (out chan bool) {
|
||||||
out = make(chan bool)
|
out = make(chan bool)
|
||||||
go func() {
|
go func() {
|
||||||
for ev := range EvChan {
|
for ev := range evChan {
|
||||||
if ev.Kind == KeyDown || ev.Kind == KeyHold {
|
if ev.Kind == KeyDown || ev.Kind == KeyHold {
|
||||||
pressed[ev.Keycode] = true
|
pressed[ev.Keycode] = true
|
||||||
} else if ev.Kind == KeyUp {
|
} else if ev.Kind == KeyUp {
|
||||||
|
Loading…
Reference in New Issue
Block a user