Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there a way in Linux that I can program the mouse to do certain things for certain programs? Like if I press the middle mouse button in one program it will act as an enter key and if I do the same thing in another program it will send a different keystroke? I'm using Gnome with compiz in Ubuntu 10.04.

share|improve this question
Please note that middle mouse button already has purpose in unix systems. It pastes highlighted text. Still it's an interesting question. – AndrejaKo Jul 31 '10 at 8:53
I was doing this kind of thing in Windows before I switched to Linux. – tony_sid Jul 31 '10 at 8:56
Yes, you can. How depends on your window manager or desktop environment (e.g., gnome, kde, fvwm, ...); add this information to your question. But keep in mind that most unix programs are designed for three-button mice and already do something useful with the middle mouse button. – Gilles Jul 31 '10 at 9:02
The programs that I'm interested in using this feature for don't use the middle mouse button. In the program I was using in Windows I just remapped the middle mouse button for a few programs and left it at default for the rest. It detect what program is active and that's how it decides whether to remap or not. It's not part of the OS. It's a program I downloaded somewhere that sits in the tray. It's called X-mouse. – tony_sid Jul 31 '10 at 12:38
up vote 0 down vote accepted

I think the imwheel utility can do that. Not having tried it myself, there's a document describing it here:

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .