Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
IT Management Project
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Formanek Balázs István
IT Management Project
Commits
9006b7a3
Commit
9006b7a3
authored
6 months ago
by
Vajay Mónika
Browse files
Options
Downloads
Patches
Plain Diff
drag update
parent
b98cf6be
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
control_mouse.py
+5
-0
5 additions, 0 deletions
control_mouse.py
with
5 additions
and
0 deletions
control_mouse.py
+
5
−
0
View file @
9006b7a3
...
...
@@ -24,6 +24,7 @@ class Mouse:
self
.
move_distance
=
10
self
.
scroll_distance
=
10
self
.
time_checking
=
0.5
self
.
stop_pos
=
None
def
get_hand_pos
(
self
,
hand_pos
):
self
.
hand_pos_x
=
hand_pos
[
0
]
...
...
@@ -63,6 +64,7 @@ class Mouse:
elif
prediction
==
"
stop moving
"
:
pyautogui
.
move
(
0
,
0
)
# Stop cursor
self
.
stop_pos
=
pyautogui
.
position
()
elif
prediction
==
"
left click
"
:
pyautogui
.
click
()
# Left click
elif
prediction
==
"
right click
"
:
...
...
@@ -81,6 +83,9 @@ class Mouse:
# THIS FUNCTION NOT WORKS ON WINDOWS
elif
prediction
==
"
drag
"
:
pyautogui
.
mouseDown
()
if
self
.
previous_action
==
"
stop moving
"
:
pyautogui
.
moveTo
(
*
self
.
stop_pos
)
hand_x
=
np
.
clip
(
int
(
self
.
hand_pos_x
*
WIDTH
),
0
,
WIDTH
-
1
)
hand_y
=
np
.
clip
(
int
(
self
.
hand_pos_y
*
HEIGHT
),
0
,
HEIGHT
-
1
)
pyautogui
.
moveTo
(
hand_x
,
hand_y
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment