Git Product home page Git Product logo

Comments (11)

LeeeSe avatar LeeeSe commented on June 12, 2024

Return to version 0.0.14 to resume normal

from enigo.

LeeeSe avatar LeeeSe commented on June 12, 2024

I don't know how to get the enigo logs to help you debug, if there is anything I can do please let me know

from enigo.

pentamassiv avatar pentamassiv commented on June 12, 2024

Hi, thank you for bringing this to my attention. There is no need for you to do anything else. I can reproduce this myself and am now checking which commit broke it. I'll try to fix it today and publish a new version. Sorry about the inconvenience

from enigo.

pentamassiv avatar pentamassiv commented on June 12, 2024

I had to revert 95e331b. A new version was released. Feel free to try it out

from enigo.

LeeeSe avatar LeeeSe commented on June 12, 2024

Another question, I found that the speed of the keyboard emulation interface provided by MacSDK is low, it takes 45ms to emulate a keyboard input on M1 Mac Air, while the win32 interface only takes ns level to emulate a keyboard input, I have no experience, so please ask if there is any other way to achieve a lower latency to emulate a keyboard input.

from enigo.

pentamassiv avatar pentamassiv commented on June 12, 2024

We intentionally sleep for a couple of ms as you can see here. Those sleeps are required on macOS for the key press to be registered. If they are pressed for too short, they are ignored. We do the same on Windows though (see here), so I am a bit confused as to why it only takes ns on Windows for you. I'd like to get rid of these sleeps, but I am not aware of any way these sleeps can be avoided :(

from enigo.

LeeeSe avatar LeeeSe commented on June 12, 2024

i've try core-foundation-rs on Mac and windows-rs on Windows
not enigo

unsafe {
            // \x08: backspace
            keybd_event(*key, 0, KEYBD_EVENT_FLAGS::default(), 0);
            keybd_event(*key, 0, KEYEVENTF_KEYUP, 0);
        }

from enigo.

pentamassiv avatar pentamassiv commented on June 12, 2024

Does that work reliably without a sleep between the press and the release of the key or are keys ignored?
If it does, I'll use that instead and get rid of the delay.

from enigo.

LeeeSe avatar LeeeSe commented on June 12, 2024

I simply tested it on the Windows platform, but not on buttons like Control, and the results seem to be fine, you can find the code herekey_test

The test results are as follows:

PS C:\Users\Administrator\code\key_speed_test> cargo run
   Compiling key_speed_test v0.1.0 (C:\Users\Administrator\code\key_speed_test)
    Finished dev [unoptimized + debuginfo] target(s) in 0.68s
     Running `target\debug\key_speed_test.exe`
Press 36 keys in 4.7608ms
PS C:\Users\Administrator\code\key_speed_test> abcdefghijklmnopqrstuvwxyz0123456789

from enigo.

LeeeSe avatar LeeeSe commented on June 12, 2024

Sorry, I made a mistake, it should be μs instead of ns, but it is fast enough and no characters are missing

from enigo.

pentamassiv avatar pentamassiv commented on June 12, 2024

Enigo no longer needs any sleeps on Windows anymore. They are still there on macOS though

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.