-
Notifications
You must be signed in to change notification settings - Fork 107
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
key_click causes app crash when using Tauri #153
Comments
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;
} |
Thank you for your feedback. One last chance would be that it was a problem with the |
I clone the repo, override the crate in my project, and upgrade the
|
Okay, I created a new PR to fix it. Could you please try with that branch? |
I encountered the same problem while using Tauri. I tried running |
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 published crate enigo-copy@v0.0.14 from the master branch and tested it, it works for me. |
I am glad it works for you with the code from master. Were you not able to use: |
i didn't expect to there to be such a method, my poor knowledge. thank u |
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 |
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? |
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 |
OK I tested enigo with tauri in only mouse mode and it works well. So the problem is only with the Also, I run directly keyboard example from enigo and it works well too. Mac OSX Ventura 13.2.1, M1 Max |
Any updates here? Or is this just frozen-in-place? I'm still having this on macos ventura (13.1) |
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: |
Tried it, same problem |
Okay, thank you for trying it out |
To anybody still having this issue. In my tauri main i added startup_tests(); to the beginning which is just a fn that moves the mouse and simulates keypresses.
I also set the enigo version to "0.1.0" I did this to test if it also crashed on startup, it didnt and suddenly the invoked function from within my app was also no longer crashing the project. I'm not sure why this worked but it no longer crashes . |
same problem here..... I should saw this issue before.... -_- |
I created a simple Tauri project. It is using Tauri 2.0 and the latest unreleased version of enigo. Please run it and let me know if it crashes. It worked fine for me on a Mac. You can run run it by executing the command Please note that it's likely not the best way to use enough with Tauri because the enigo struct gets created each time. The project will also not work on Linux. |
Describe the bug
Application will crash when calling key_click function;
To Reproduce
Expected behavior
No crash.
Environment (please complete the following information):
Additional context
I have read this pr #124 and I use the master branch of this crate, but I still have the problem in
create_string_for_key
fn.I try to debug it, and when the code executes to the
TISGetInputSourceProperty
the application will crash.The text was updated successfully, but these errors were encountered: