asweigart / pyautogui

A cross-platform GUI automation Python module for human beings. Used to programmatically control the mouse & keyboard.
BSD 3-Clause "New" or "Revised" License
10.22k stars 1.24k forks source link

Smooth Scrolling #640

Open ravasan opened 2 years ago

ravasan commented 2 years ago

Hi, I was just trying to let a terminal app smoothly scroll but couldn't figure out a way to do it. So I was wondering if there was a way to smoothly scroll "n clicks". Scrolling "1 click" and doing time.sleep(x) is not right because the scroll is not "smooth". It is a noticeable and jagged way to scroll. Is there a way to reduce how big "1 click" is?

Or is there a way to scroll as we do in browsers(scroll by n pixels for some n, instead of "clicks") using which we could emulate smooth scrolling? Any idea on what we need to do to get smooth scroll to work?