Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
pentamassiv committed Feb 15, 2023
1 parent 1ae93a7 commit 667e1eb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@

## Fixed
- Windows: panicked at `cannot transmute_copy if U is larger than T` (https://github.com/enigo-rs/enigo/issues/121)
- Windows: Inconsistent behavior between the `mouse_move_relative` and `mouse_move_to` functions (https://github.com/enigo-rs/enigo/issues/91)
3 changes: 2 additions & 1 deletion src/win/win_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,8 @@ impl MouseControllable for Enigo {
}

fn mouse_move_relative(&mut self, x: i32, y: i32) {
mouse_event(MOUSEEVENTF_MOVE, 0, x, y);
let (current_x, current_y) = self.mouse_location();
self.mouse_move_to(current_x + x, current_y + y);
}

fn mouse_down(&mut self, button: MouseButton) {
Expand Down

0 comments on commit 667e1eb

Please sign in to comment.