Refactor mouse button handling to use string literals instead of ButtonType constants; add debug print for screenshot action in web server
This commit is contained in:
@@ -5,13 +5,13 @@ def press_mouse(mouse_input: MouseInput) -> None:
|
||||
"""Presses mouse buttons at the given position."""
|
||||
x, y = mouse_input.x, mouse_input.y
|
||||
button = mouse_input.click_type
|
||||
if button == ButtonType.LEFT:
|
||||
if button == "left":
|
||||
pyautogui.click(x, y, button='left')
|
||||
elif button == ButtonType.DOUBLE_LEFT:
|
||||
elif button == "double_left":
|
||||
pyautogui.doubleClick(x, y)
|
||||
elif button == ButtonType.RIGHT:
|
||||
elif button == "right":
|
||||
pyautogui.click(x, y, button='right')
|
||||
elif button == ButtonType.MIDDLE:
|
||||
elif button == "middle":
|
||||
pyautogui.click(x, y, button='middle')
|
||||
|
||||
def press_keyboard(keyboard_input: KeyboardInput) -> None:
|
||||
|
Reference in New Issue
Block a user