mirror of
https://github.com/go-vgo/robotgo.git
synced 2025-06-02 23:23:55 +00:00
add more add event examples
This commit is contained in:
parent
ca2a57ea6e
commit
7ec766458d
@ -17,6 +17,25 @@ import (
|
|||||||
// "go-vgo/robotgo"
|
// "go-vgo/robotgo"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
func addEvent() {
|
||||||
|
ok := robotgo.AddEvents("q", "ctrl", "shift")
|
||||||
|
if ok {
|
||||||
|
fmt.Println("add events...")
|
||||||
|
}
|
||||||
|
|
||||||
|
ok = robotgo.AddEvents("w")
|
||||||
|
if ok {
|
||||||
|
fmt.Println("add events")
|
||||||
|
}
|
||||||
|
|
||||||
|
s := robotgo.Start()
|
||||||
|
defer robotgo.End()
|
||||||
|
|
||||||
|
for ev := range s {
|
||||||
|
fmt.Println(ev)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func add() {
|
func add() {
|
||||||
fmt.Println("--- Please press v---")
|
fmt.Println("--- Please press v---")
|
||||||
eve := robotgo.AddEvent("v")
|
eve := robotgo.AddEvent("v")
|
||||||
@ -61,5 +80,7 @@ func event() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
addEvent()
|
||||||
|
|
||||||
event()
|
event()
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user