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
16e83a10
Commit
16e83a10
authored
8 months ago
by
Formanek Balázs István
Browse files
Options
Downloads
Patches
Plain Diff
sprint #1
parent
f69019c2
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
moni_dev/move_mouse.py
+27
-0
27 additions, 0 deletions
moni_dev/move_mouse.py
moni_dev/test_manipulations.py
+16
-0
16 additions, 0 deletions
moni_dev/test_manipulations.py
moni_dev/use_keyboard.py
+54
-0
54 additions, 0 deletions
moni_dev/use_keyboard.py
with
97 additions
and
0 deletions
moni_dev/move_mouse.py
0 → 100644
+
27
−
0
View file @
16e83a10
import
pyautogui
import
keyboard
import
time
# Function to move the mouse in the specified direction
def
move_mouse
(
move_distance
=
10
,
time_checking
=
0.005
,
scroll_distance
=
5
):
while
True
:
if
keyboard
.
is_pressed
(
'
W
'
):
pyautogui
.
move
(
0
,
-
move_distance
)
# Move up
elif
keyboard
.
is_pressed
(
'
S
'
):
pyautogui
.
move
(
0
,
move_distance
)
# Move down
elif
keyboard
.
is_pressed
(
'
A
'
):
pyautogui
.
move
(
-
move_distance
,
0
)
# Move r
elif
keyboard
.
is_pressed
(
'
D
'
):
pyautogui
.
move
(
move_distance
,
0
)
# Move right
elif
keyboard
.
is_pressed
(
'
L
'
):
pyautogui
.
click
()
# Left click
elif
keyboard
.
is_pressed
(
'
R
'
):
pyautogui
.
click
(
button
=
'
right
'
)
# Right click
elif
keyboard
.
is_pressed
(
'
up
'
):
pyautogui
.
scroll
(
scroll_distance
)
# Scroll upp
elif
keyboard
.
is_pressed
(
'
down
'
):
pyautogui
.
scroll
(
-
scroll_distance
)
# Scroll down
time
.
sleep
(
time_checking
)
# Adjust speed of movement
\ No newline at end of file
This diff is collapsed.
Click to expand it.
moni_dev/test_manipulations.py
0 → 100644
+
16
−
0
View file @
16e83a10
import
pyautogui
import
keyboard
import
time
from
move_mouse
import
move_mouse
from
use_keyboard
import
press_button
# Start listening for key presses
if
__name__
==
"
__main__
"
:
print
(
"
Use the arrow keys to move the mouse. Press
'
Esc
'
to exit.
"
)
# Exit the program when 'Esc' is pressed
try
:
while
not
keyboard
.
is_pressed
(
'
esc
'
):
press_button
()
except
:
print
(
"
Program terminated.
"
)
\ No newline at end of file
This diff is collapsed.
Click to expand it.
moni_dev/use_keyboard.py
0 → 100644
+
54
−
0
View file @
16e83a10
import
pyautogui
import
keyboard
import
time
# Function to move the mouse in the specified direction
def
press_button
(
time_checking
=
0.005
):
shift_held
=
False
control_held
=
False
while
not
keyboard
.
is_pressed
(
'
esc
'
):
if
keyboard
.
is_pressed
(
'
W
'
):
pyautogui
.
press
(
'
up
'
)
elif
keyboard
.
is_pressed
(
'
S
'
):
pyautogui
.
press
(
'
down
'
)
# Move down
elif
keyboard
.
is_pressed
(
'
A
'
):
pyautogui
.
press
(
'
right
'
)
# Move r
elif
keyboard
.
is_pressed
(
'
D
'
):
pyautogui
.
press
(
'
left
'
)
# Move right
elif
keyboard
.
is_pressed
(
'
O
'
):
pyautogui
.
press
(
'
enter
'
)
elif
keyboard
.
is_pressed
(
'
P
'
):
pyautogui
.
press
(
'
space
'
)
if
keyboard
.
is_pressed
(
'
M
'
):
if
not
control_held
:
pyautogui
.
keyDown
(
'
ctrl
'
)
control_held
=
True
print
(
"
PRESSED CTRL
"
)
elif
keyboard
.
is_pressed
(
'
N
'
):
if
control_held
:
pyautogui
.
keyUp
(
'
ctrl
'
)
control_held
=
False
print
(
"
released CTRL
"
)
if
keyboard
.
is_pressed
(
'
B
'
):
if
not
shift_held
:
pyautogui
.
keyDown
(
'
shift
'
)
shift_held
=
True
print
(
"
PRESSED shift
"
)
elif
keyboard
.
is_pressed
(
'
V
'
):
if
shift_held
:
pyautogui
.
keyUp
(
'
shift
'
)
shift_held
=
False
print
(
"
released shift
"
)
if
keyboard
.
is_pressed
(
'
E
'
):
pyautogui
.
press
(
'
esc
'
)
print
(
"
esc pressed
"
)
time
.
sleep
(
time_checking
)
# Adjust speed of movement
\ No newline at end of file
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