Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

A simple, cross-platform GUI automation module for Rust.

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT
NotificationsYou must be signed in to change notification settings

autopilot-rs/autopilot-rs

Repository files navigation

DocsCrates.ioAppveyor Build StatusGithub Build Status

AutoPilot

AutoPilot is a Rust port of the Python C extensionAutoPy, a simple, cross-platform GUI automation library forPython. For more information, see theREADMEon that repo.

Currently supported on macOS, Windows, and X11 with the XTest extension.

Examples

The following will move the mouse across the screen as a sine wave:

externcrate autopilot;externcrate rand;use rand::Rng;constTWO_PI:f64 = std::f64::consts::PI*2.0;fnsine_mouse_wave(){let screen_size = autopilot::screen::size();let scoped_height = screen_size.height /2.0 -10.0;// Stay in screen bounds.letmut rng = rand::thread_rng();for xin0..screen_size.widthasu64{let y =(scoped_height*((TWO_PI* xasf64) / screen_size.width).sin() +                  scoped_height).round();let duration:u64 = rng.gen_range(1,3);        autopilot::mouse::move_to(autopilot::geometry::Point::new(            xasf64,            yasf64)).expect("Unable to move mouse");        std::thread::sleep(std::time::Duration::from_millis(duration));}}

This will enter the keys from the string "Hello, world!" and then prompt analert with the same text:

externcrate autopilot;fnmain(){    autopilot::key::type_string("Hello, world!",&[],200.,0.);let _ = autopilot::alert::alert("Hello, world!",None,None,None);}

Contributing

If you are interested in this project, please consider contributing. Here are afew ways you can help:

License

This project is licensed under either theApache-2.0 orMIT license, at your option.

Unless you explicitly state otherwise, any contribution intentionally submittedfor inclusion in the work by you, as defined in the Apache-2.0 license, shall bedual licensed as above, without any additional terms or conditions.

About

A simple, cross-platform GUI automation module for Rust.

Topics

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Packages

No packages published

Contributors19

Languages


[8]ページ先頭

©2009-2025 Movatter.jp