Comments (18)
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.
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.
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.
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.
Okay, I created a new PR to fix it. Could you please try with that branch?
#161
from enigo.
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.
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.
i published crate [email protected] from the master branch and tested it, it works for me.
from enigo.
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.
i didn't expect to there to be such a method, my poor knowledge. thank u
from enigo.
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.
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.
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.
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.
Any updates here? Or is this just frozen-in-place? I'm still having this on macos ventura (13.1)
from enigo.
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.
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.
Okay, thank you for trying it out
from enigo.
Related Issues (20)
- Should we rename key_sequence? HOT 1
- Fix enigo for multiple monitors HOT 1
- key_down crash with raw keys HOT 4
- macOS: CapsLock not working HOT 1
- Improve equivalence of keys across platforms HOT 2
- Collection of differences between Rustdesks version and our version HOT 1
- Wrong input on Mac 13.3 HOT 10
- install error HOT 3
- Enigo could work with programs that use DirectX/DirectInput HOT 7
- Can't get enigo working in Tauri app on MacOS HOT 5
- key_sequence() method doesn't take line return into account. HOT 2
- Do not panic when `SetCursorPos` fails HOT 4
- I am offline until the end of the month HOT 1
- Media keys Windows only? HOT 2
- Core dumped when invoking `mouse_location()` on Linux. HOT 3
- Mouse does not move on macOS unless `mouse_location` is called after moving the mouse HOT 2
- [Performance Issue] Enigo blocks other inputs while clicking HOT 2
- How to extend window size by dragging window boundaries HOT 2
- [Feature request] Allow listening to keyboard input and replacing it with something else HOT 4
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.