Git Product home page Git Product logo

Comments (2)

HyperCodec avatar HyperCodec commented on June 12, 2024

you can ignore the second paragraph, I'm probably going to have to just wait until this is better optimized or something. as i mentioned before, this is directly copy/pasted from my SO post.

from enigo.

pentamassiv avatar pentamassiv commented on June 12, 2024

Thank you for your report. If you experience any problems with enigo or have other questions, opening issues in this repo is the right place to ask. I don't monitor stackexchange for questions related to enigo.

Regarding your question: Yes, unfortunately this is a known problem. Windows seems to need a delay between the keydown and the keyup event. We have an intentional delay in the code (e.g. here). If you call it many times in a loop, everything afterwards is delayed because we don't enter it in parallel.

A workaround that might work for you could be to call

enigo.mouse_down(MouseButton::Left)
enigo.mouse_up(MouseButton::Left)

in the loop. Those functions intentionally don't have a delay. You probably have to sleep for a couple of milliseconds in between. Otherwise it might not click the expected number of times.

If you want to enter text, it is better to use the key_sequence function. It also has a delay, but it can enter multiple characters at once.

I had a brief look at the code of the python library you mentioned and I can't see a delay there. I have to look more into it to understand how they can avoid it. It would be very welcome if we could get rid of it.

I am closing this for now. We have an issue regarding the delay already: #45

Feel free to reopen the issue, if you have more questions :-)

from enigo.

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.