robot-1.3: Simulate keyboard and mouse events

Safe HaskellNone

Test.Robot.Connection

Contents

Description

Functions for managing connections manually.

Synopsis

Managing connections

runRobot opens a new connection every time it is called. If you call it too many times, it will exhaust the connection pool, causing a "maximum number of clients reached" error.

This module lets you avoid this error by handling the connection manually.

Example:

 main = do
     Just conn <- connect
     replicateM_ 500 $ do
         runRobotWith conn $ tap _A
         putStrLn "Ducks!"

runRobotWith :: Connection -> Robot a -> IO aSource

Run the robot using an existing connection.

connect :: IO ConnectionSource

Connect to the X11 server.