robot-1.4: Simulate keyboard and mouse events

Safe HaskellNone
LanguageHaskell98

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
    conn <- connect
    replicateM_ 500 $ do
        runRobotWith conn $ tap _A
        putStrLn "Ducks!"

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

Run the robot using an existing connection.

connect :: IO Connection Source

Connect to the X11 server.