Comments (2)
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.
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)
- Win: Is it necessary to set the MessageExtraInfo? HOT 1
- win: Use an array in `SendInput` to get rid of sleep HOT 2
- In some games, special keys can't be triggered HOT 13
- Reading key presses HOT 4
- win: Check if alt-gr works
- character sequence manual delay HOT 3
- Inconsistent number of newlines produced by `\n` in `key_sequence` HOT 1
- Is EnigoSettings Unavailable on Windows HOT 2
- Volume up / down doesn't work on MacOS HOT 6
- macOS: Use objc2 instead of objc HOT 3
- Invoking multiple keys at the same time does not seem to register HOT 4
- Selecting text isn't working HOT 3
- `text` seems to miss certain characters, consistently HOT 12
- Support BSDs HOT 4
- State of 0.2 releases HOT 6
- Mouse moves to the wrong coordinates HOT 4
- Choose between xdo and wayland at runtime HOT 1
- Doesn't work as expected in simulation “Ctrl+C" HOT 2
- Screenshot under window does not work HOT 1
- Special characters are not working with ShiftKey
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 enigo.