Comments (4)
Please see #2,It is a function.But is a huge project.
from robotgo.
谢谢,明白了。期待这个功能的实现。
from robotgo.
If you want to know when to finish,please star and watch.
from robotgo.
对于热键的监听实现我想采用goroutine+AddEvents/AddEvent的方式实现
Example code:
package main
import (
"fmt"
"github.com/go-vgo/robotgo"
"time"
)
func main() {
go addKeysListen("q", "ctrl")
go addKeyListen("k")
for {
// do something
time.Sleep(time.Millisecond * 50)
}
}
func addKeysListen(key string, arr ...string) {
for {
if ok := robotgo.AddEvents(key, arr...); ok {
fmt.Println("pressed Ctrl + q")
}
}
}
func addKeyListen(key string) {
for {
if ok := robotgo.AddEvent(key); ok {
fmt.Println("Pressed k")
}
}
}
如果我只监听一个热键的话是ok的,但是超过一个就会失效,
请问您能更改下底层代码,支持这种写法吗? or 已经有了更优雅的解决方案?
from robotgo.
Related Issues (20)
- robotgo is incompatible with Go 1.21 HOT 6
- GetHWNDByPid failed
- Feature Request: Screenshot background windows
- Mouse Location correct In Windows 11 laptop with a resolution of 2560x1600 HOT 1
- gcv.FindX 查找图像不存在时 程序会崩溃
- KeyTap capslock in ubuntu will cause panic
- Move mouse to wrong location on multiple monitor HOT 2
- -mthreads vs -pthread compile error HOT 1
- Support multi xvfb?
- Support for Wayland?
- "RobotGo: DragSmooth Operation Not Triggering hook.MouseDrag Event on macOS Sonoma" HOT 1
- Can not get latest version v1.0.0-rc3
- TypeStr writes wrong characters
- I'm having issues with cross-compiling. HOT 2
- 使用goroutine并发去bitmap.Find图片的时候大概率闪退
- The process ID is not available
- Wayland support?
- building Fails
- Multiple monitors on windows causes cursor relative movement issues
- undefined: Bitmap HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from robotgo.