Skip to content

Instantly share code, notes, and snippets.

@AxDSan
Created May 31, 2022 19:56
Show Gist options
  • Save AxDSan/2a25d8c65aac675469d33cc32c9b4435 to your computer and use it in GitHub Desktop.
Save AxDSan/2a25d8c65aac675469d33cc32c9b4435 to your computer and use it in GitHub Desktop.
A small python script to steadily move the mouse when seeking through the scrub bar in YouTube
#! python3
import pyautogui, keyboard, sys
print('Press Ctrl-C to quit.')
try:
while True:
x, y = pyautogui.position()
# if active window contains "youtube"
if keyboard.is_pressed('shift'):
# keep mouse at the same position
if "youtube" in pyautogui.getActiveWindowTitle().lower():
pyautogui.moveTo(x,865)
except KeyboardInterrupt:
print('\n')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment