autopilot.display - Get information about the current display(s)

The display module contaions support for getting screen information.

autopilot.display.is_rect_on_screen(screen_number, rect)[source]

Return True if rect is entirely on the specified screen, with no overlap.

autopilot.display.is_point_on_screen(screen_number, point)[source]

Return True if point is on the specified screen.

point must be an iterable type with two elements: (x, y)

autopilot.display.is_point_on_any_screen(point)[source]

Return true if point is on any currently configured screen.

autopilot.display.move_mouse_to_screen(screen_number)[source]

Move the mouse to the center of the specified screen.

class autopilot.display.Display[source]

The base class/inteface for the display devices.

static create(preferred_backend='')[source]

Get an instance of the Display class.

For more infomration on picking specific backends, see Advanced Backend Picking

Parameters:preferred_backend

A string containing a hint as to which backend you would like.

possible backends are:

  • X11 - Get display information from X11.
  • UPA - Get display information from the ubuntu platform API.
Raises:RuntimeError if autopilot cannot instantate any of the possible backends.
Raises:RuntimeError if the preferred_backend is specified and is not one of the possible backends for this device class.
Raises:BackendException if the preferred_backend is set, but that backend could not be instantiated.
Returns:Instance of Display with appropriate backend.
exception BlacklistedDriverError[source]

Cannot set primary monitor when running drivers listed in the driver blacklist.

Display.get_num_screens()[source]

Get the number of screens attached to the PC.

Display.get_primary_screen()[source]
Display.get_screen_width(screen_number=0)[source]
Display.get_screen_height(screen_number=0)[source]
Display.get_screen_geometry(monitor_number)[source]

Get the geometry for a particular monitor.

Returns:Tuple containing (x, y, width, height).