Is there a Python equivalent to Java's AWT Robot class?

Stuart K picture Stuart K · May 13, 2009 · Viewed 10.1k times · Source

Does anyone know of a Python class similar to Java Robot?

Specifically I would like to perform a screen grab in Ubuntu, and eventually track mouse clicks and keyboard presses (although that's a slightly different question).

Answer

Nadia Alramli picture Nadia Alramli · May 13, 2009

If you have GTK, then you can use the gtk.gdk.Display class to do most of the work. It controls the keyboard/mouse pointer grabs a set of gtk.gdk.Screen objects.