简体   繁体   English

在屏幕上重新定位鼠标光标

[英]Relocate mouse cursor on screen

I am using Python and PyCharm. 我正在使用Python和PyCharm。 In my script I am trying to move the mouse to the top corner of the screen ((0,0) I think). 在我的脚本中,我试图将鼠标移到屏幕的顶部(我认为是((0,0))。

I googled and found uinput however got this when trying to install it using: 我用谷歌搜索,发现uinput但是在尝试使用以下命令安装时得到了此信息:

sudo pip install python-uinput 

I get the following error: 我收到以下错误:

/usr/bin/ld: cannot find libudev.so.0
collect2: error: ld returned 1 exit status
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
----------------------------------------
Cleaning up...

I do have libudev installed and the cosponsoring headers. 我确实安装了libudev和cosponsoring标头。

Some advice would be very appreciated! 一些建议将不胜感激!

Maybe even another simple way to move the mouse to the top left corner as I am still very inexperienced. 也许还有另一种简单的方法将鼠标移动到左上角,因为我仍然经验不足。

Thanks for that! 感谢那! I am using Mint 16 at the moment. 我目前正在使用Mint 16。 SOLVED: Used the following: from pymouse import PyMouse m = PyMouse() m.move(0, 0) 求解:使用以下命令:从pymouse导入PyMouse m = PyMouse()m.move(0,0)

To note I had to install the python-xlib 注意,我必须安装python-xlib

sudo apt-get install  python-xlib

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM