mirror of
https://github.com/go-vgo/robotgo.git
synced 2025-06-01 14:43: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"
|
||||
)
|
||||
|
||||
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() {
|
||||
fmt.Println("--- Please press v---")
|
||||
eve := robotgo.AddEvent("v")
|
||||
@ -61,5 +80,7 @@ func event() {
|
||||
}
|
||||
|
||||
func main() {
|
||||
addEvent()
|
||||
|
||||
event()
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user