Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

This question has already been asked, but for Windows: http://superuser.com/questions/50726/is-it-possible-to-lock-the-mouse-to-one-screen

I am using Ubuntu 10.04 with 2 screens with different resolution. Getting the mouse cursor moving accidentally from one screen to another is really annoying.

Is it possible to temporarily lock the mouse to one screen, and possibly releasing it with a shortcut ?

share|improve this question
    
Does ubuntuforums.org/showthread.php?t=903415#post9643088 help at all? –  Hello71 Aug 7 '10 at 16:50
    
One other option is to add a bumper... you can set it up so the mouse will only switches if it goes a certain number of pixels past the edge of the screen. –  Dan Aug 10 '10 at 21:37
add comment

2 Answers

up vote 3 down vote accepted

Got it working! Better than in Windows !!

The trick is to separate the 2 screen by a virtual space in xorg.conf , then use a tool called mouse-switchscreen to "jump" between the screens.

My config: Ubuntu 10.04 x64, ATI Mobility RadeonHD , ATI Catalyst Control Center correctly installed, screens in mode "Single Display Desktop" (each screen has it's own Desktop)

These are the steps that I made:

  1. Download dualscreen-mouse-utils from http://digamma.cs.unm.edu/trac.dmohr/wiki/DualscreenMouseUtils
  2. Decompress the package, in terminal type: make , you may need to xorg-dev package (in Ubuntu: sudo apt-get install xorg-dev )
  3. Copy the mouse-switchscreen binary to folder included in PATH (I used /usr/bin)
  4. Start gconf-editor (Alt-F2), in apps\metacity\keybinding_commands choose an empty command, and add: mouse-switchscreen -f 1
  5. In gconf-editor apps\metacity\global_keybindings choose the same number for run_command_n and add a shortcut of your choice, personnally I entered: < Super>Tab =Win+Tab (without space before Super)
  6. If everything is working, Edit /etc/X11/xorg.conf (better make a backup before), in the "ServerLayout" section, change the position of a screen to make the two separate. ONE pixel is enough :D

You can now sudo /etc/init.d/gdm restart and enjoy. Of course, Win+Tab to switch the screen. You can also try mouse-wrapscreen, mouse-wrapscreen -h for more info.

All credits goes to: David Antliff & David Mohr for mouse-switchscreen, and the Linux community for the infos.

share|improve this answer
1  
if you get an undefined reference error during compile, add LDLIBS=-lX11 to the Makefile. –  Wimmel Nov 16 '13 at 21:05
add comment

This isn't too much of a fix as it is an annoyance minimizer, but in System->Preferences->Monitors, drag the 2nd monitor to the edge so that they only touch corners. Theoretically, that means it'll only transfer over if you pull the mouse into a corner. On the Gentoo Wiki, they posted a small program that might work also. I bade you luck.

share|improve this answer
    
Excellent! No need to download anything. This is working like a charm in Ubuntu 12.04. Thank you for sharing. –  Geppettvs D'Constanzo Sep 16 '12 at 15:14
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.