Giter Site home page Giter Site logo

Comments (4)

vcaesar avatar vcaesar commented on May 22, 2024

Please see #2,It is a function.But is a huge project.

from robotgo.

geekjunyi avatar geekjunyi commented on May 22, 2024

谢谢,明白了。期待这个功能的实现。

from robotgo.

vcaesar avatar vcaesar commented on May 22, 2024

If you want to know when to finish,please star and watch.

from robotgo.

essenwbb avatar essenwbb commented on May 22, 2024

对于热键的监听实现我想采用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 已经有了更优雅的解决方案?

ps: 我的项目 粘贴板 记录器.
@vcaesar

from robotgo.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.