how to control mouse/cursor/pointer speed using python? [closed]

萝らか妹 提交于 2019-12-13 03:55:27

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!