enigo-rs / enigo

Cross platform input simulation in Rust
MIT License
893 stars 95 forks source link

macOS: Use objc2 instead of objc #249

Closed pentamassiv closed 6 months ago

pentamassiv commented 6 months ago

The objc seems to no longer be maintained and objc2 is a good replacement. Many larger projects already use it, as can be seen in the list of dependents.

https://crates.io/crates/objc2

pentamassiv commented 6 months ago

@paulora2405, maybe you can also do this while you are touching the macOS code?

paulora2405 commented 6 months ago

Seems easy enough to replace, will try to close this as soon as I can.

What is the proper way of validating any changes like these?

pentamassiv commented 6 months ago

If I make some bigger changes, I just manually test the various functions of the Keyboard and Mouse traits (I use and slightly change the examples for that). Theoretically there are some tests, but there are not enough and they are not written well. They use the browser to detect key presses and mouse movements. I always wanted to improve that but did not get to it yet.

For dependency updates I usually assume "If it builds, it works". Probably not ideal though.