模拟鼠标点击Python [英] Simulate Mouse Clicks on Python

查看:241
本文介绍了模拟鼠标点击Python的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在使我的任天堂Wiimote(实际上伤心)与我的电脑作为一个鼠标。我设法使双节棍的控制实际上移动鼠标上下左右在屏幕上!这是如此令人兴奋。现在我被困了。



我想离开/右键点击通过python的东西,当我按A,当我去做一个搜索,所有它想出了是tkinter吗?



所以我的问题是,我调用什么使python左/右键单击桌面,如果可能,可能提供一个代码片段? p>

感谢您的帮助!



注意:我想我忘了提到这是Linux。 p>

解决方案

python-uinput非常容易使用。



http://tjjr.fi/software/python-uinput/



下面是一个示例 https:// github。 com / tuomasjjrasanen / python-uinput / blob / master / examples / mouse.py


I'm currently in the process of making my Nintendo Wiimote (Kinda sad actually) to work with my computer as a mouse. I've managed to make the nunchuk's stick control actually move the mouse up and down, left and right on the screen! This was so exciting. Now I'm stuck.

I want to left/right click on things via python when I press A, When I went to do a search, All it came up with was tkinter?

So my question is, What do I call to make python left/right click on the desktop, and if it's possible, maybe provide a snippet?

Thank you for your help!

NOTE: I guess I forgot to mention that this is for Linux.

解决方案

python-uinput is very easy to use.

http://tjjr.fi/software/python-uinput/

Here's an example https://github.com/tuomasjjrasanen/python-uinput/blob/master/examples/mouse.py

这篇关于模拟鼠标点击Python的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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