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

force current position on move_mouse() to solve windows bug #22

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/keep-presence.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,12 @@ def move_mouse_when_unable_to_move(expected_mouse_position):

def move_mouse():
global mouse_direction

delta_x = PIXELS_TO_MOVE if mouse_direction == 0 or mouse_direction == 3 else -PIXELS_TO_MOVE
delta_y = PIXELS_TO_MOVE if mouse_direction == 0 or mouse_direction == 1 else -PIXELS_TO_MOVE

currentPosition = mouse.position

new_x = currentPosition[0] + delta_x
new_y = currentPosition[1] + delta_y
mouse_direction = (mouse_direction + MOUSE_DIRECTION_DELTA) % 4
Expand Down