-   Linux - Hardware (
-   -   Program mouse wheel (

Steve W 06-19-2010 03:38 AM

Program mouse wheel
I know I should be able to find information on how to do this somewhere else on the internet, but every promising link seems not to answer this specific question. Even "similar threads" in LQ lead to dead links or non-solutions to the problem.

I would like to program the middle "roller" button of my Microsoft Mouse so that clicking down on it executes a "quit application" (Alt-F4) function.

One solution I found said I should edit the xorg.conf file. I did a system-wide search for this and could not locate it on my system. Could this advice be out-of-date and Ubuntu 9.10 does not now have an xorg.conf file?


yooy 06-19-2010 04:34 AM

try checking xorg.conf location on web? This question has been answered before..

Steve W 06-19-2010 04:09 PM

Yes, thanks - should have thought of that before posting.

However, having done some research I now have a more particular problem. The key to programming mouse buttons seems to lie in a program called "imwheel", which I have installed. However try as I might I cannot figure out how its config file "imwheelrc" is meant to work. I did some Googling but many pages seem to repeat the same info from, but I can't work out what I want to do from this page.

It seems I start off by specifying a section in imwheelrc that relates to the application I want to change mouse behaviour for. This would be GQView, so I kick off the section with:


But now I am at a loss as to how to specify that clicking the middle wheel button should do the same thing as ALT-F4, i.e. exit the program. In fact, in none of the examples is the middle mouse button mentioned, nor the word I should use for it. Left, right, up, down all refer to other buttons, or presumably the up & down functions of the wheel.

Does anyone have specific knowledge of using imwheel in this way, please?


MTK358 06-20-2010 08:06 AM

Why do you want the middle button to close the app? Unlike that stupid Window$ autoscroll thing, it's immensely useful in Linux!

You can select text and click the middle button to paste it, no Ctrl+C or menus needed!

Clicking links with it in a browser opens them in a new tab.

Clicking browser tabs with the middle button closes them.

In some window managers, dragging one window onto another with the middle button combines them into one window with a tab bar on top to choose the window to be displayed.

Clicking anywhere in a slider or scrollbar with the middle button causes the slider to jump right to that position, instead of to scroll one page toward it.

And in many cases the middle button provides a secondary or complementary action.

Steve W 06-24-2010 03:49 AM

Ah yes, but this "middle wheel to close" would only apply to the application I chose for it, and would not affect any other app, like Firefox, where I agree the middle button to close tab function is useful.

So if I actually got this working, it would only be gqview that this would apply in.

Many years ago, when I used Windows 98 with a multi-buttoned Trust mouse (that had a button on the side of the mouse, just in front of where your thumb lays), I could program that to close the current window, and that was very useful. This was in the days when Internet Explorer opened a new window for every link, before tabbed browsing became the norm.

So anyway - it is possible anyone could help me with the way this imwheelrc file is meant to work, please?


MTK358 06-24-2010 06:42 AM

As I said, the middle button is convenient for much more than tabbed browsing.

Steve W 06-24-2010 08:43 AM

Not in GQView it isn't, and that's the only app that would be affected.


alexeykaramazov 02-23-2013 03:34 PM

Relief for repetitive stress syndrome using the wheel button.
Thanks to MTK358. I've been getting a sore left hand from repetitive stress syndrome, so I was searching to see if using the wheel button might help me with the copy and paste operations -- I needed to relieve all the stress I was putting on my left hand with one-handed performance of Ctrl-C (copy) and Ctrl-v (paste) operations.

I thought I might have to program this operations, but was so pleased to learn that the wheel-button is already programmed to do exactly what I need!

But I only use linux at home, so I'll have to figure out how to program my work computer (which is windows based). Sigh.

All times are GMT -5. The time now is 10:04 AM.