Search code examples
pythonlinuxautomationscreenshotawtrobot

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


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).


Solution

  • 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.