Aug-31-2021, 12:19 PM
There is a library called
Link to documentation:
https://github.com/boppreh/mouse
mouse
. It has a function called mouse.hook(callback)
. I'm trying to use this function to input mouse actions into a program where it otherwise wouldn't work. It has documentation explaining what it does, but I'm not quite sure what I need to do with said function.Quote:Installs a global listener on all available mouses, invoking callback each time it is moved, a key status changes or the wheel is spun. A mouse event is passed as argument, with type either mouse.ButtonEvent, mouse.WheelEvent or mouse.MoveEvent.Any ideas how I can integrate this function into my code so that the mouse does X upon keypress?
Returns the given callback for easier development.
1 2 3 4 5 6 |
import mouse import keyboard while True : if keyboard.is_pressed( ']' ): mouse.hook(mouse.move( 10 , 0 , False , duration = 0.01 )) |
https://github.com/boppreh/mouse