Git Product home page Git Product logo

Comments (18)

pentamassiv avatar pentamassiv commented on June 12, 2024

Hmm, that's not good. In a few days I should be able to borrow a Mac and then I can try it myself. Which keyboard layout are you using? Maybe it has to do with that?

from enigo.

jackeydou avatar jackeydou commented on June 12, 2024

Hmm, that's not good. In a few days I should be able to borrow a Mac and then I can try it myself. Which keyboard layout are you using? Maybe it has to do with that?

I tried the Chinese layout and English layout, and both of them have the same problem.

I find a simple demo of the usage of TISCopyCurrentKeyboardInputSource in stackoverflow, and I executed the code below, it runs ok, that's so weird.

#include <Carbon/Carbon.h>
int main() {
    char layout[128];
    memset(layout, '\0', sizeof(layout));
    TISInputSourceRef source = TISCopyCurrentKeyboardInputSource();
    // get input source id - kTISPropertyInputSourceID
    // get layout name - kTISPropertyLocalizedName
    CFStringRef layoutID = TISGetInputSourceProperty(source, kTISPropertyInputSourceID);
    CFStringGetCString(layoutID, layout, sizeof(layout), kCFStringEncodingUTF8);
    printf("%s\n", layout);
    return 0;
}

from enigo.

pentamassiv avatar pentamassiv commented on June 12, 2024

Thank you for your feedback. One last chance would be that it was a problem with the core_graphics crate and it was already fixed. Could you please try with the changes from #131? If that also fails, I need to look into it on a mac. I hope I will be able to reproduce it so I can investigate it.

from enigo.

jackeydou avatar jackeydou commented on June 12, 2024

I clone the repo, override the crate in my project, and upgrade the core-graphics crate, but the problem remains.

[dependencies]
serde_json = "1.0"
serde = { version = "1.0", features = ["derive"] }
tauri = { version = "1.2", features = ["app-all", "clipboard-all", "global-shortcut-all", "http-all", "shell-open"] }
enigo = "0.0.14"

[patch.crates-io]
enigo = { path = "../../../github/enigo" }

from enigo.

pentamassiv avatar pentamassiv commented on June 12, 2024

Okay, I created a new PR to fix it. Could you please try with that branch?
#161

from enigo.

mino01x avatar mino01x commented on June 12, 2024

I encountered the same problem while using Tauri. I tried running cargo run --example keyboard in the master branch, and it worked. However, upon further investigation, I discovered that the code of the crate I had installed was different from that in the master branch. Therefore, I switched to the last published commit and ran cargo run --example keyboard, but still faced the same issue.

from enigo.

pentamassiv avatar pentamassiv commented on June 12, 2024

Yes, that is a known problem with Tauri. Unfortunately we currently do not know why this happens. Any insight into it would be very much appreciated. I tried out a bunch of stuff but nothing fixed it. There is an open ticket in the tauri repo tauri-apps/tauri#6421 but so far there has not been any activity on it.
I probably will not have the time to look into Tauri for the next couple of months to investigate this further. Any help on this would be very much appreciated :)

from enigo.

mino01x avatar mino01x commented on June 12, 2024

i published crate [email protected] from the master branch and tested it, it works for me.

from enigo.

pentamassiv avatar pentamassiv commented on June 12, 2024

I am glad it works for you with the code from master. Were you not able to use:
enigo = { git = "https://github.com/enigo-rs/enigo" }
in your Cargo.toml file or how come you published it on crates.io?

from enigo.

mino01x avatar mino01x commented on June 12, 2024

i didn't expect to there to be such a method, my poor knowledge. thank u

from enigo.

pentamassiv avatar pentamassiv commented on June 12, 2024

Okay, no problem. It is impossible to delete crates from crates.io, so it is recommended to use a git dependency if you want to try out things like this. Otherwise all names will be used up and authors of libraries will have a problem to find a good name. It is unlikely anybody would want to publish a library under the name enigo-copy, so it's no problem :)

from enigo.

frasermince avatar frasermince commented on June 12, 2024

Hey just wanted to jump in on this. Even after setting my enigo crate to master I am still seeing this issue. Any idea if there's currently a fix for this?

from enigo.

pentamassiv avatar pentamassiv commented on June 12, 2024

Yes, this is still a known issue even on master. I don't know what the issue is so I can't fix it. There also has not been any activity in the issue opened in the tauri repo. If you want to look into the root cause, I would be very glad to fix it

from enigo.

ufon avatar ufon commented on June 12, 2024

OK I tested enigo with tauri in only mouse mode and it works well. So the problem is only with the key_click method.

Also, I run directly keyboard example from enigo and it works well too.

Mac OSX Ventura 13.2.1, M1 Max

from enigo.

alaninnovates avatar alaninnovates commented on June 12, 2024

Any updates here? Or is this just frozen-in-place? I'm still having this on macos ventura (13.1)

from enigo.

pentamassiv avatar pentamassiv commented on June 12, 2024

I did not have the time to check it out. I wanted to add wayland support and x11 support without xdotools before. There is an issue at the tauri repo where a fix was suggested but nobody seemed to have tried it:
tauri-apps/tauri#6421 (comment)

from enigo.

gaandurian avatar gaandurian commented on June 12, 2024

I did not have the time to check it out. I wanted to add wayland support and x11 support without xdotools before. There is an issue at the tauri repo where a fix was suggested but nobody seemed to have tried it: tauri-apps/tauri#6421 (comment)

Tried it, same problem

from enigo.

pentamassiv avatar pentamassiv commented on June 12, 2024

Okay, thank you for trying it out

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.