如何使用python控制鼠标/光标/指针速度? [英] how to control mouse/cursor/pointer speed using python?

查看:48
本文介绍了如何使用python控制鼠标/光标/指针速度?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个 tkinter GUI,我想控制我程序中光标的速度(就像您通过调整鼠标设置使用 Windows 控制面板来设置它一样).
我想我可以使用 pywin32 但我能找到的只是设置光标在屏幕上的位置,但我真正想要的是设置鼠标的速度/慢速 ??
所以..
我应该使用哪些库?哪些功能可以让我控制鼠标的速度/加速度?
谢谢

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

推荐答案

你应该精确地使用你使用的 windows 版本;).

You should precise the windows version you use ;).

我认为你可以使用一些东西.

There is something I think you could use.

SIKULI 项目

函数=>Settings.MoveMouseDelay |似乎做你想做的事.

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.

可以通过运行 (win+R) "main.cpl" 访问 windows 鼠标属性在 Windows 7 上它看起来像

The windows mouse properties can be accessed by run (win+R) "main.cpl" on windows 7 it looks like

您可以创建一个 .bat 来启动它并使用您的 python 脚本启动您的 .bat 脚本,然后管理获得的窗口以设置鼠标速度.

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.

问候,

这篇关于如何使用python控制鼠标/光标/指针速度?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆