I'm running Ubuntu 12.04 and working with python 2. I would like to be able to control my mouse, and I have found several different python modules intended to do this, but cannot get them to work.
I installed dogtail, but when I try:
dogtail.rawinput.click(x,y)
I get:
AttributeError: 'module' object has no attribute 'rawinput'
I then tried pymouse and although I used pip to install it when I import pymouse:
from pymouse import PyMouse
I get:
TypeError: Object value must be tuple, dictionary or DictWrapper: 0
I tried the uinput module as well but the mouse commands only seemed to work when placed in a loop, which is frustrating/ridiculous.
If anyone knows how to fix either of those problems/what I'm doing wrong/better or easier to use modules I would much appreciate the help.
I'll assume that my problem is the same as yours, given the limited error information. The full exception and traceback I got was:
Note the exception occurs in Xlib. I had version 0.15rc1 installed. Downgrading to 0.14 fixed the problem.
this is my piece of code
the first two arguments ar for X,Y the last argument to define wich click 1=left click 2=right i wish it helps
I recomend you install pyautogui. You can control mouse and write.
Example:
use pynput . It can control mouse, keyboard, etc.
examples: