问题
I have a tkinter
GUI ,and I would like to control the speed of the cursor inside my programme (as if you would set it up using windows control panel by adjusting the mouse settings there) .
I guess I can use pywin32
but all I can find is setting the position of the cursor on the screen but what I really want is setting how fast/slow the mouse can be ??
So ..
What libraries Should I use ? and what exact functions allow me to control the speed/acceleration of the mouse ?
Thanks
回答1:
You should precise the windows version you use ;).
There is something I think you could use.
PROJECT SIKULI
The function => Settings.MoveMouseDelay | seems to do what you want.
Another solution would be to get the current and the last position of the mouse cursor, then you can slow it artificially by set the cursor position to the mid of the current and the last position etc. But it seems messy.
The windows mouse properties can be accessed by run (win+R) "main.cpl" on windows 7 it looks like

You can create a .bat to launch that and launch your .bat script with your python script and then manage the obtained window to set the mouse speed.
Seems tricky but may work.
Regards,
来源:https://stackoverflow.com/questions/24068725/how-to-control-mouse-cursor-pointer-speed-using-python