Tuesday, March 24, 2009

Python mouse move in 5 lines of code (Linux only)

from Xlib import X, display
d = display.Display()
s = d.screen()
root = s.root
root.warp_pointer(300,300)
d.sync()

7 comments:

Pedro Cavaléro said...

Foi quase um import linux.... hehhehe
E da-lhe python!
Abraço!
posted from my kubuntu 8.10!

Anonymous said...

Precisei adicionar um:

d.sync()

ao final para que funcionasse.

Daniel Lélis Baggio said...

Opa, corrigido, obrigado :)

Anonymous said...

Thanks for sharing...Google

Unknown said...

Hola Daniel, necesito contactarme contigo para hablar sobre GPUCV, soy Marcelo Pistarelli de Facultad de Ingeniería de Rosario, Argentina

Daniel Lélis Baggio said...

Please, can you get me at danielbaggio at the gmail dot com?

Anonymous said...

you have a nice site. thanks for sharing this enormous resources. keep it up. anyway, various kinds of ebooks are available here

http://feboook.blogspot.com