CCSM answer for 11.04
On Ubuntu 11.04, the compizconfig-settings-manager (CCSM) "Put" plugin can be used to set a shortcut for moving the active window to the next output or monitor in a multiple monitor system. In the Bindings tab of the Put module under Window Management, set Ctrl+Alt+z (or other if this does not work) as the shortcut for "Put to Next Output"
If Compiz sees your setup as a single monitor, use "Put Within Viewport" Left/Right instead (forum thread 1588821)
Warning about CCSM on 11.10
CCSM is broken on Ubuntu 11.10, in part because it uses gconf2 backend, in part because it disables Unity plugin due to keybinding conflicts with its own plugins. As a result, the unity launcher disappears.
To get the launcher back, remove the ~/.config/compiz-1 directory. You can obtain a terminal with Ctrl+Alt+F2, or a Nautilus window with Ctrl+N from the desktop (from where you can run /usr/bin/xterm), or Ctrl+Alt+T to launch Terminal. For ccsm config purge, remove .gconf/apps/compiz-1/ and .gconf/apps/compizconfig-1/ and ~/.compiz-1, and then run unity --reset for unity defaults.
Way forward: Using dconf and dconf-tools it may be possible to configure a shortcut by directly modifying the config tree.
Postscript by @DrSAR: The CCSM steps did not work for the OP (even though others have benefited from it). This might be related to the problem of compiz seeing only one monitor.
PS: Use at your own risk since somehow installing and using compizconfig-settings-manager eventually disabled unity for the OP to the point of a seemingly irretrievable launcher and panel.
Best Answer
Script to connect screens "circular"
The script below will do as you describe; if the mouse touches the right edge of the right (-most) screen, the mouse re- appears on the left (-most) screen. If it touches the left side of the left screen, it re- appears on the right side of the right screen.
Built- in precautions
The script assumes the screens are arranged in a non- overlapping configuration, x-wise, but it has a built- in correction in case the screens are not top- aligned, or of a different y- resolution. Although you wouldn't run into problems in most cases, in the situation below you would, unless the script takes into account the possible differences in y- resolution and /or (un-) alignment of the screens:
If the top of the left screen is below the top of the right screen, the cursor moves from top- right to the top of the left screen. Possibly un- aligned bottom idem ditto
The script
How to use
The script needs
xdotool
circular_mouse.py
Test- run the script by running in a terminal:
You should be able to make an infinite mouse movement to either right or left, circulation through your screens.
If all works fine, add it to startup applications: Dash > Startup Applications > Add the command: