Skip to content
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

Can't move the mouse to second screen #47

Open
IAFahim opened this issue Feb 14, 2023 · 1 comment
Open

Can't move the mouse to second screen #47

IAFahim opened this issue Feb 14, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@IAFahim
Copy link

IAFahim commented Feb 14, 2023

Can't move the mouse to second screen

use autopilot::geometry::Point;
use autopilot::mouse::Button;

fn main() {
    let mut point = Point::new(-1920.0 / 2.0, 454.0);
    autopilot::mouse::move_to(point).unwrap();
    autopilot::mouse::click(Button::Left,Some(50));
}

thread 'main' panicked at 'called Result::unwrap() on an Err value: OutOfBounds', src\main.rs:6:38
stack backtrace:
0: std::panicking::begin_panic_handler
at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library\std\src\panicking.rs:575
1: core::panicking::panic_fmt
at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library\core\src\panicking.rs:65
2: core::result::unwrap_failed
at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library\core\src\result.rs:1791
3: enum2$<core::result::Result<tuple$<>,enum2$autopilot::mouse::MouseError > >::unwrap<tuple$<>,enum2$autopilot::mouse::MouseError >
at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943\library\core\src\result.rs:1113
4: office_owl::main
at .\src\main.rs:6
5: core::ops::function::FnOnce::call_once<void (*)(),tuple$<> >
at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943\library\core\src\ops\function.rs:251
note: Some details are omitted, run with RUST_BACKTRACE=full for a verbose backtrace.
error: process didn't exit successfully: target\debug\office_owl.exe (exit code: 101)

Process finished with exit code 101

@IAFahim IAFahim changed the title Cant move the mouse the my second screen Can't move the mouse to second screen Feb 14, 2023
@msanders msanders added the bug Something isn't working label Mar 13, 2023
@supersational
Copy link

Can be fixed by deleting

if !screen::is_point_visible(destination) {
        return Err(MouseError::OutOfBounds);
    }

and changing fn move_to into:

pub fn move_to(point: Point) -> Result<(), MouseError> {
    system_move_to(point);
    Ok(())        
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants