# Microsoft IntelliMouse Optical Configuration

## Knight

After doing long periods of searching through various mailing lists I've found a perfect configuration setup for the Microsoft IntelliMouse Optical that allows the use of all 5 buttons (the 3 buttons and the 2 side ones) along with the wheel and even got the side buttons to recognize as mouse4 and mouse5 in games. First you need to do these changes/additions to your /etc/X11/XF86Config file:

```
Section "InputDevice"

        Identifier  "Mouse0"

        Driver      "mouse"

        Option      "Protocol" "ExplorerPS/2"

        Option      "Device" "/dev/input/mice"

        Option      "Buttons" "7"

        Option      "ZAxisMapping" "6 7"

        Option      "Resolution" "100"

EndSection

```

The protocol ExplorerPS/2 is a specialized X mouse protocol that allows for the mapping of buttons beyond the 5 button limit used in IMPS/2. Once this is done the AxisMapping has to be changed from 4 5 to 6 7. However we're not quite done yet, because we changed the axis mapping we have to update xmodmap to adjust to the settings. You can do that with the following:

```
xmodmap -e "pointer = 1 2 3 6 7 4 5"
```

This remaps the pointer settings and detects the 2 side buttons and resets the mouse wheel so it's still usable. You have to do this setting everytime so to remove that burden place that command in either your ~/.xinitrc file or in the session config files for KDM, XDM, or GDM depending on the graphical login manager file you use. I hope this helps out!

----------

## elboricua

Just to expand on your tip  :Very Happy:   You can use a little program called IMWheel to enable those side buttons.  ImWheel can be found at :

http://jcatki.no-ip.org/imwheel/

Here are the steps that I used to setup IMWheel.  I set the side buttons to do back and forward in mozilla.  I got this info from searching the boards here,  reading the imwheel docs, and trial and error.  

Step 1 Edit /etc/X11/XF86Config

Section "InputDevice"

# Identifier and driver

Identifier "Mouse1"

Driver "mouse"

Option "Protocol" "ExplorerPS/2"

Option "Device" "/dev/usbmouse"

Option "Buttons" "7"

Option "ZAxisMapping" "6 7"

Step 2 Add the following line to ~/.xinitrc. Make sure to put it before whatever line loads your window manager.  You can also create a ~/.xmodmap with the same info if you use gdm, kdm or xdm.

exec xmodmap -e "pointer = 1 2 3 6 7 4 5" &

That will set the scroll whell to use buttons 6 and 7. 4 and 5 are the side buttons.

Step 3 Install imwheel. Installing is your standard fair. Untar the file, cd into the new directory

./configure

make

make install

If you allow for all the defaults this will load the executable to /usr/local/bin. The config file is in /etc/X11 by default

EDIT:  STEP 3 emerge imwheel  (it has since become available in portage)   :Very Happy: 

Step 4 Now to got used to those buttons performing forward and back.

Copy /etc/X11/imwheelrc that to imwheelrc.bak.

(It has a lot of things that I just could not get to work.)

edit /etc/X11/imwheelrc with your favorite text editor to read

".*"

None, Up, Alt_L|Left

None, Down, Alt_L|Right

Step 5 Edit ~/.xinitrc and add the line before your window manager is loaded but after the xmodmap entry or edit your  session config files for KDM, XDM, or GDM

exec imwheel -k -b "67" &

Step 6 Restart X to get the changes loaded.

Using this method will let the X server control the wheel while imwheel controls the side buttons. After installing imwheel man imwheel for more information on setting up the side buttons.

----------

## allucid

awesome. you guys are great.   :Very Happy: 

----------

## wHAcKer

hmm, if i put this in my startup script (the xmodmap -e pointers line) it doesn't do anything (my mousewheel still doesn't work) but if I type it manually, it works perfectly :/

i don't get this!!!  :Sad: 

'nyone got an idea?[/code]

----------

## wHAcKer

i think i solved it, damn, the feeling that you're beginning to understand a linux system rules  :Wink: 

----------

## zhenlin

There appears to be an imwheel ebuild. Reduce installation to one step... emerge imwheel

----------

## fishers4rus

OK, get to the .xinitrc or .xmodmap files, just cant get them to work.  A manual execution of the command will do it tho--like whacker did--how did you solve it?

----------

## fishers4rus

And i cant seem to locate the imwheel ebuild with emerge -s imwheel....

----------

## zhenlin

It is a very new package. Just look at the Changelog:

 *Quote:*   

> 
> 
> *imwheel-1.0.0_pre2 (13 Nov 2002)
> 
>   13 Nov 2002; Nick Hadaway <raker@gentoo.org>
> ...

 

----------

## wHAcKer

i just added it in the file that i use to start programs automatically when i log in in X

----------

## elboricua

HeeHee Cool IMWheel is now in portage

emerge -s imwheel

Searching...   

[ Results for search key : imwheel ]

[ Applications found : 1 ]

*  x11-misc/imwheel

      Latest version available: 1.0.0_pre2

      Latest version installed: [ Not Installed ]

      Size of downloaded files: 470 kB

      Homepage:    http://jcatki.dhs.org/imwheel/

      Description: mouse tool for advanced features such as wheels and 3+ buttons

I am going to have to edit the tip   :Very Happy: 

----------

## elmie

THis is great stuff.. thank you.. 

I guess this $100 mouse is not a waste after all!!!

Great guide, but I still can't the 2 side thumb buttons to work...

what am I doing wrong??

I did everything like you said..

----------

## elboricua

Did you edit /etc/X11/imwheelrc to have only

```
".*"

None, Up, Alt_L|Left

None, Down, Alt_L|Right
```

and do you have exec imwheel -k -b "67" set to startup with X somewhere?

----------

## sev_

awesome. thanks for the guide  :Cool: 

i couldn't get it to start up by sticking it in .xsession, so i just created a simple shell script to do it for me, and then dropped that into .xsession (i use gdm).

```
#! /bin/bash

/usr/X11R6/bin/xmodmap -e "pointer = 1 2 3 6 7 4 5"

/usr/bin/imwheel -k -b "67"
```

----------

## canthus13

Umm... Dunno how this is possible, but I apparently don't have any .xinitrc file.  I do have .xinitrc~, which has a line put in it by enlightenment, but that's all... (Dunno if it makes any difference, but I only use root on this system, against conventional wisdom. I'm the only user on the system, so screw it.  :Smile: 

Me

----------

## nitro322

I have severel Logitech MouseMan models, including PS/2, USB, and wireless.  These mice function similarly to the Intellimouse (or, more properly, I should say the Inellimouse functions similarly to Logitech mice  :Very Happy:  ), but have only 1 thumb button.  The X and imwheel config is slightly different, so here are the config options I'm using to enable Back on the thumb button.  Follow the general steps above, but modify your config files to look similar to this:

```
/etc/X11/XF86Config:

...

Section "InputDevice"

     ...

     Option "Protocol" "ExplorerPS/2"

     Option "Buttons" "6"

     Option "ZAxisMapping "5 6"

EndSection

...
```

```
/etc/X11/imwheelrc:

".*"

None, Up, Alt_L|Left

```

By the way, just to try to clear up any confusion out there (I was unclear about this when reading this thread), you can enable this automatically in two ways.  If you type startx to load X, create/modify your ~/.xinitrc to look similar to this:

```
~/.xinitrc:

xmodmap -e "pointer = 1 2 3 6 4 5"

imwheel -k -b "6"

exec startkde

```

If you use a display manager, you'll need to modify the session config file for whichever display manager you use.  In my case:

```
/etc/X11/Sessions/kde-3.0.5a:

xmodmap -e "pointer = 1 2 3 6 4 5"

imwheel -k -b "6"

/usr/kde/3/bin/startkde

```

There may be an easier way to set that up for your display manager, but this should work.

Hopefully this will help out any Logitech users out there having trouble getting the config options modified just right.  And thanks a whole lot to the original two posters of the tip.  I've been wanting this for about 4 years now, ever since I got my first Mouseman and cried when I realized the Back button didn't work in Linux.    :Evil or Very Mad:   Thanks!Last edited by nitro322 on Mon Feb 24, 2003 5:39 am; edited 1 time in total

----------

## Ivion

Sorry for digging up this thread, but I got a problem.

I've configured everything like you all said, and xev confirms the mappings, but Mozilla doesn't respond to the side-buttons.

Does anyone of you have an idea?

offtopic:

I also can't change anything when I start up mozilla as a mortal (aka normal user  :Razz: ). Not the skin, not the extension, etc.

I can't even reach them, because when I'm logged in as a normal user there aren't any menu's to do that...  :Smile: 

----------

## idl

you should also refer to this

thread to make your mouse smoother.

Resoltuion "100" is no way near the mouses potential.

Happy mouseing!   :Very Happy: 

----------

## darktux

Just wanted to post my 2  cents   :Wink: 

If you have a "Addison Technology" optical mouse with 5 buttons + wheel, then this is the way:

```

    Identifier  "Mouse1"

    Driver      "mouse"

    Option "Protocol"    "ExplorerPS/2"

    Option "Device"      "/dev/psaux"

    Option "Buttons" "7"

    Option "ZAxisMapping" "4 5"

    Option "Resolution" "1200"

```

----------

## S_aIN_t

Xmodmap is  a great resource. Because you can so things like switching your caps lock with the ctrl key. It is much easier to reach.

do 

```
man xmodmap
```

 and you will learn more.  :Very Happy: 

----------

## Alex_K

i'm useing GDM, and it's not possible for me to execute the xmodmap and imwheel command automatically.

i have tried to write these commands in following files:

~/.xinitrc

~/.Xmodmap

~/.xmodmap

~/.xsession

/etc/X11/Xmodmap

/etc/X11/gdm/Sessions/Xsession

/etc/X11/gdm/Sessions/Gnome

if i run the commands manualy it works ...

i don't know what the problem could be.

----------

## timmfin

I just have put this line in my .xinitrc. Not as elegent but I know it works:

```
/usr/X11R6/bin/xmodmap -e "pointer = 1 2 3 6 7 4 5" &

```

----------

## idl

I have an IntelliMouse explorer, and without IMWheel my side buttons are not recognised, so i use imwheel.

So i assigned crouch and walk to my side buttons in CS, but when i press them in game my view nudges up a little instead what i assigned them to do :/

I cant see anything in the imwheelrc file about not using the button for movement. I just want a plain old 'click' as it were....

any ideas?

----------

## Alex_K

 *timmfin wrote:*   

> I just have put this line in my .xinitrc. Not as elegent but I know it works:
> 
> ```
> /usr/X11R6/bin/xmodmap -e "pointer = 1 2 3 6 7 4 5" &
> 
> ...

 

i have tried that, but the problem ist, that the .xinitrc isn't executed if gdm is runnung ...

----------

## vibidoo

I have followed this tips , and get the usb mouse working , but .

During the boot , my some usb module  failed to load : 

```

Calculating module dependencies...

Loading module nvidia 

Loading module usb-uhci

Loading module mousedev

Loading module hid 

Failed to load hid 

Loading module usbmouse

Failed to load usbmouse 

```

but on console I type 

```

insmod hid 

Using /lib/modules/2.4.20/kernel/drivers/usb/hid.o

insmod usbmouse

Using /lib/modules/2.4.20/kernel/drivers/usb/usbmouse.o

```

so only with this upper line the usbmouse work .

Why during the boot hid and usbmouse module's can not be load ?

----------

## brainlock

I've got some problems with imwheel... Here is what I have done so far :

Like other people here I had some problems with the placement of the xmodmap instruction. Finally, I read my /etc/rc.conf file and found that since I have DISPLAYMANAGER=gdm and XSESSION=Gnome, the script that really gets loaded in my case is /etc/X11/Sessions/Gnome.

Now if you read that script, you will see that for system-wide use of the 7 buttons with the wheel working properly, you need to make a file called /etc/X11/Xmodmap in which u put this line:

```
pointer = 1 2 3 6 7 4 5
```

After u restart X, your mouse wheel will work as expected. Now here is where I run into problems... where do I put the imwheel -k -b "67" command? I have tried putting it in the /etc/X11/Sessions/Gnome script after it loads the Xmodmap file but that doesn't work.

Furthermore, when I type it in the console, this is what I get:

```
bash-2.05b$ imwheel -k -b "67"

WARNING: imwheel process could not be verified, it may not be running anymore, that's OK!

: No such file or directory

WARNING: imwheel pid file could not be removed.

  Perhaps you want the -p option.

  Or SUID root the imwheel executable...

: Operation not permitted

ERROR: Couldn't write pid to pid file

  Perhaps you want the -p option to avoid this...

  Otherwise you may SUID root the imwheel executable.

: Permission denied
```

What is the problem here?

Any help appreciated,

Brainlock

----------

## vibidoo

Ok I have mu usb mouse working 

But I would like to impove it 

I have put this on my /etc/X11/Sessions/kde3.1 file 

```

xmodmap -e "pointer = 1 2 3 6 7 4 5 "

imwheel -k b "67"

```

On a web page I can use the wheel , but to use it I have to push on the wheel and turn it .

What I would like to do is just to turn the wheel it without to have to push it .

I hope you understand my request 

Sorry for my english

----------

## TelMarien

Think in the desktop install guide say's you are only suppose to use one or the other never both (hid or usbmouse). I have hid loaded seems to work fine.

----------

## stig

Here is some extra info that might help someone...

When I tried to get the buttons to work with mozilla (1.2.1-r3) I encountered som problems. The nice little app "xev" told me that all the buttons were working (Intellimouse Explorer PS/2) but it didn't do anything in the browser. 

After having followed this useful thread, I put (amongst other things) 

```
imwheel -k -b "67" 
```

in my /etc/X11/Sessions/fluxbox. 

When I excecuted the command manually, It worked fine with mozilla, but when put in the startup file, it didn't. 

When I changed the line in /etc/X11/Sessions/fluxbox to:

```
imwheel -p -k -b "67" 
```

 thus adding an additional "-p" made it work fine.

Hope it helps someone.

----------

## Bowyakka

I cheated and just made imwehll suid root  :Sad: 

 *brainlock wrote:*   

> I've got some problems with imwheel... Here is what I have done so far :
> 
> Like other people here I had some problems with the placement of the xmodmap instruction. Finally, I read my /etc/rc.conf file and found that since I have DISPLAYMANAGER=gdm and XSESSION=Gnome, the script that really gets loaded in my case is /etc/X11/Sessions/Gnome.
> 
> Now if you read that script, you will see that for system-wide use of the 7 buttons with the wheel working properly, you need to make a file called /etc/X11/Xmodmap in which u put this line:
> ...

 

----------

## stig

...but did you try adding "-p" to imwheel when putting it in /etc/X11/Sessions/Gnome?

----------

## sun_downsi

K... I've read through this board.. Great tips!

 :Exclamation:  Please note though. Mozilla on it's own DOES NOT RECOGNIZE THE TWO SIDE BUTTONS ON THE INTELLIMOUSE EXPLORER! This is fluent through the Windows, Mac, and Linux versions.

Later

----------

## vibidoo

I would like to come back to 3 buttons instead of 5 

I just bought a new Optcal wireless blue mouse .

my XF86Config was

```

Identifier  "Mouse0" 

    Driver      "mouse" 

    Option "Protocol"    "ExplorerPS/2" 

    Option "Device"      "/dev/usbmouse" 

    Option "Buttons" "7" 

    Option "ZaxisMapping" "6 7" 

    Option "Resolution" "1200" 

 
```

This configuration work with my previous Usb Intellimouse Explorer .

But now to get my blue Optical mouse working I try 

```

Identifier  "Mouse0" 

    Driver      "mouse" 

    Option "Protocol"    "ExplorerPS/2" 

    Option "Device"      "/dev/usbmouse" 

    Option "Buttons" "3" 

    Option "ZaxisMapping" "4 5" 

    Option "Resolution" "1200" 

 
```

But I can just move verticaly

please what is the right configuration ?

My usb wireless receiver is well recognize as 

```

input0 : Microsoft Microsoft Wireless Optical Mouse 1.0A on usb1:2.0

```

----------

## jetblack

 *vibidoo wrote:*   

> I would like to come back to 3 buttons instead of 5 
> 
> But now to get my blue Optical mouse working I try 
> 
> ```
> ...

 

Is this a wheel mouse? Even if it's only a "3 button" wheel mouse (where the wheel is the middle button), you will need to tell X that it has 5 buttons. Change Option "Buttons" "3" to Option "Buttons" "5". Otherwise, it won't recognize that there are buttons 4 and 5 to map the scroll wheel to.

Not sure if this addresses the problem you are currently having, but it should make the mouse behave more like you'd expect.

----------

## vibidoo

yes it's a wheel mouse 

I change from 3 to 5 buttons 

still the same problem

----------

## vibidoo

Here my test with the usb -> PS2 adaptor

```

Identifier  "Mouse0" 

    Driver      "mouse" 

    Option "Protocol"    "ExplorerPS/2" 

    Option "Device"      "/dev/mouse" 

    Option "Buttons" "5" 

    Option "ZaxisMapping" "4 5" 

    Option "Resolution" "1200" 

```

The mouse is working very well and the wheel run well on Mozilla.

Now connect directly to the USB

```

Identifier  "Mouse0" 

    Driver      "mouse" 

    Option "Protocol"    "ExplorerPS/2" 

    Option "Device"      "/dev/usbmouse" 

    Option "Buttons" "5" 

    Option "ZaxisMapping" "4 5" 

    Option "Resolution" "1200" 

```

I still can only move verticaly

----------

## vibidoo

I fix it by

 ismod hid 

rather than

 insmod usbmouse

So now my mouse is working , but I can not use the wheel 

What do I have to modify on xmodmap ?

I tried this

```

xmodmap -e "pointer = 1 5 3 2 4"

imwheel -k b "45"

```

----------

## vibidoo

Everything is fixed

I just have to put this 

```

xmodmap -e "pointer = 1 2 3 4 5" 

#imwheel -k -b "45" 

```

No need imwheel   :Confused: 

----------

## Sastraxi

'twill it work on the MX5/700s from Logitech? (I picked me up one of these MX500 beauties  :Smile: ).

----------

## Ric

I noticed after i installed imwheel, that nautilus would never go back in directorys when i used the side button, but mozilla and phoenix worked find. Then i finally got around to compiling moz with GTK2, and the side buttons stopped working with there as well (same with ephiphany).

Anyone else having problems with GTK2 apps?

----------

## Sastraxi

Just so anyone knows, it works beautifully on my MX500. Mouse4/5 work flawlessly in RtCW, soon I will try it in WineX/CS.

----------

## Kodama

Great! Thanks for the info Knight and Megatron.

----------

## grant.mcdorman

Anybody interested?

I don't have a web site, and I feel it's too small for a SourceForge project all on its own.

Drop me a message if you're interested.

----------

## doalwa

Yeah, you guys totally rule, my mouse works perfect now   :Cool: 

Quake 3 , here I come   :Laughing: 

----------

## buckets

 *Alex_K wrote:*   

> i'm useing GDM, and it's not possible for me to execute the xmodmap and imwheel command automatically.
> 
> i have tried to write these commands in following files:
> 
> ~/.xinitrc
> ...

 

I had the exact same problem, I fixed it by adding -p to the imwheel arguments:

```
imwheel -k -p -b "67"
```

I guessing here but I think my problem was that users didn't have rights to change the PID file so -p means ignore the PID file and just run the program.

----------

## cytrox

Great Tip!   :Smile: 

Just an additional note, you can make your imwheel config working on a per-application basis, mine looks like this:

~/.imwheelrc:

```

"konqueror"

None, Up, Alt_L|Right

None, Down, Alt_L|Left

"kmail"

None, Up, plus

None, Down, minus

```

that way, in konqueror the two buttons act as Back and Forward buttons, whereas in kmail they act as "previous unread message" and "next unread message".

Just put the window class or window name as regex in .imwheelrc (instead of the generic ".*") and have a look which keyboad shortcut performs the desired action (in kmail "+" and "-" for prev and next unread msg), and bind them to the buttons in .imwheelrc.

----------

## Drewgrange

I love this thread  :Smile:  I've always wanted to be able to use these nice little side buttons in linux. I've got one small problem though. They work as intended in konq, but in mozilla they work just like the mouse wheel. 

Is it safe to just erase everything in the mozilla sections "Left RIght & Thumb stuff" section except for the needed None, Up, ..... None, Down, .... lines? I guess I could always just try and see if my mouse breaks  :Smile: 

----------

## Drewgrange

No dice. Maybe its because I just upgraded to 1.4a. Oh well, thats what I downloaded mouse gestures for

----------

## Vache

I've gone through all the steps I've found in this post regarding the mouse configuration, but all my mouse does is scroll vertically now. Any clicks of the buttons send the mouse a few inches over to the right at a time. Perhaps someone could do a quick summary of all the information that has been presented here (?)

----------

## capran

 *Quote:*   

> 
> 
> i'm useing GDM, and it's not possible for me to execute the xmodmap and imwheel command automatically.
> 
> i have tried to write these commands in following files:
> ...

 

I'm having the same issue. I have the following my .xsession (copied to both my user and root home dirs:

#! /bin/bash

/usr/X11R6/bin/xmodmap -e "pointer = 1 2 3 6 7 4 5"

/usr/bin/imwheel -k -b "67"

/usr/X11R6/bin/xmodmap .Xmodmap

I've chmod +x it, copied it to .kderc, but it still doesn't load at startup. I'm wondering if anyone has had any luck.

----------

## AlphaChild

is there any way of being able to get the side buttons working via GPM instead of IMWheel? i have experimented a little, but no success...

----------

## doener

hid & usbmouse conflict with each other. Use either one or the other, not both.

Check the manual: 

http://www.gentoo.org/doc/en/desktop.xml

----------

## ventricle

I can't get X to work properly yet at all, but when I try to setup the mouse, I don't have usb-uhci or usbcore modules. Can someone tell me where these are in the kernel menuconfig? I do have input, hid and mousedev.

Thanks.

----------

## irasnyd

```
bash-2.05b$ imwheel -k -b "67"

WARNING: imwheel process could not be verified, it may not be running anymore, that's OK!

: No such file or directory

WARNING: imwheel pid file could not be removed.

  Perhaps you want the -p option.

  Or SUID root the imwheel executable...

: Operation not permitted

ERROR: Couldn't write pid to pid file

  Perhaps you want the -p option to avoid this...

  Otherwise you may SUID root the imwheel executable.

: Permission denied
```

How do I "SUID root the imwheel executable"?

It turns out that "chmod 4755 /usr/bin/imwheel" worked perfectly.  I solved my own problem :p

This method of doing it worked much better for me than using the -p option of imwheel.

irasnyd

----------

## samnet

I had the problem of the side buttons scrolling up and down the screen.  If you make a ~/.imwheelrc, it will actually use your settings.

----------

## Dalcius

 *brainlock wrote:*   

> Like other people here I had some problems with the placement of the xmodmap instruction. Finally, I read my /etc/rc.conf file and found that since I have DISPLAYMANAGER=gdm and XSESSION=Gnome, the script that really gets loaded in my case is /etc/X11/Sessions/Gnome.
> 
> Now if you read that script, you will see that for system-wide use of the 7 buttons with the wheel working properly, you need to make a file called /etc/X11/Xmodmap in which u put this line:
> 
> ```
> ...

 

Muchas gracias!  I wrestled with this problem once before, but never figured out a solution.  I was trying to modify my init scripts instead of pay attention to what they were actually doing.

This solved my problem, my wheel and side buttons are working as designed (although I have yet to try IMwheel).  Thanks again!

----------

## RedBeard0531

Just wondering, why dont linux programmes write programs that use thes buttons nativly. I mean they've been around for several years now, and the only way to use them is through these "hacks".

----------

## Naughtyus

I've followed the instructions to a T with my Intellimouse Optical.  When I booted to fluxbox, it worked perfectly, but when I reboot into gnome or kde, the thumb buttons are acting how the scroll should, and I can't tell what the scroll-wheel is doing (it does do something, but it doesn't seem consistant).

Any suggestions?

----------

## Vache

Here is another "Now what?" post... I have followed all the steps exactly, edited my .xinitrc and imwheelrc file. Thumb buttons act as up/down buttons, and scroll wheel only works when I'm directly over the scroll bar (and it doesn't even do it in all applications--just some). In Mozilla Firebird it doesn't do anything at all. Something is wrong with my IMWheel config? I added the ".*" config in to the file (I didn't remove anything else though -- should I?)

----------

## Pindrop

How do I configure the left thumb button to be the enter key? Is this possible?

Edit: MS Intellimouse Optical   :Very Happy: 

----------

## Blackace

Certainly!

To make the thumb button perform an <enter> keystroke, you would need something like this in either your /etc/X11/imwheelrc or your ~/.imwheelrc:

```
"^GnomeTerminal"

None, Up, Enter
```

Replace "^GnomeTerminal" with whatever application you want to do it in.  "None" is the modifier key (e.g. Control_L would be press thumb button while holding the left control key), "Up" is the mouse button you want to use, since I run imwheel like this:

```
# imwheel -p -b "672"
```

(6 = the big thumb button, 7 = the little thumb button, 2 = middle button)

imwheel assigns the buttons you specify in this order: Up, Down, Left, Right, Thumb1, Thumb2.  So, Up = big thumb, Down = little thumb, Left = middle.

Hope this helps (btw, you can find way more information in the manpage for imwheel).

Blackace.

----------

## El_Presidente_Pufferfish

can you bind the alt-tab button on logitech mx300, 500, and 700's?

----------

## root@jez

you can't load usbmouse and hid 

you can only have one or the other 

i have MS Intellimouse Optical and i use hid and it works fine 

i tried usbmouse first with no success

----------

## Blackace

 *El_Presidente_Pufferfish wrote:*   

> can you bind the alt-tab button on logitech mx300, 500, and 700's?

 

Sure, just use an entry in your .imwheelrc file like this:

```
None, Thumb1, Alt_L|Tab
```

Blackace.

----------

## root@jez

I have edited my XF86Config correctly 

```

Identifier   "Mouse1"

    Driver   "mouse"

    Option    "Protocol" "ExplorerPS/2"

    Option    "Device" "/dev/input/mice"

    Option    "Buttons" "7"

    Option    "ZAxisMapping" "6 7"

    Option    "Resolution" "100"   

```

but when i try to xmod map i get an error...

```

bash-2.05b# xmodmap -e "pointer = 1 2 3 6 7 4 5"

xmodmap:  commandline:0:  bad number of buttons, must have 5 instead of 7

xmodmap:  1 error encountered, aborting.

```

is there something else i should have done??

----------

## Blackace

I would assume that you have restarted X in between those two steps ?

Other than that, I don't see anything offhand...

Sorry,

Blackace.

----------

## gmichels

 *root@jez wrote:*   

> you can't load usbmouse and hid 
> 
> you can only have one or the other 
> 
> i have MS Intellimouse Optical and i use hid and it works fine 
> ...

 

Well I do have hid and usbmouse enabled and it's working flawlessly.

```
# lsmod

Module                  Size  Used by    Tainted: P

ide-scsi                8912   0

sd_mod                 11212   0  (unused)

sg                     29324   0  (unused)

sr_mod                 16696   0  (unused)

scsi_mod               58868   4  [ide-scsi sd_mod sg sr_mod]

nvidia               1542240  10

es1371                 29352   1

ac97_codec             11080   0  [es1371]

soundcore               4164   4  [es1371]

usbmouse                2296   0  (unused)

hid                    19492   0  (unused)

ehci-hcd               15688   0  (unused)

usb-uhci               24236   0  (unused)

usbcore                64992   1  [usbmouse hid ehci-hcd usb-uhci]

mousedev                4372   1

input                   3648   0  [usbmouse hid mousedev]

apm                    10152   2
```

The weird part is that I don't have usbmouse on modules.autoload, but the system loads it by it's own. At first (without usbmouse), my mouse wouldn't work at all, so while recompiling the kernel, I added usbmouse as a module just in case I needed it to play with the modules. Also, if I rmmod usbmouse, my Intellimouse Explorer stops working. Weird, huh?  :Very Happy: 

----------

## CovertCow

I have to say a big THANK YOU for putting this together.  My Intellimouse explorer is currently working perfectly

----------

## Ard Righ

Just to confuse this topic even more -  https://forums.gentoo.org/viewtopic.php?t=64701

 I don't use IMwheel at all, I have the mouse working fine in Gnome 2, it scrolls etc just as I need it.

 I haven't mapped any buttons to the thumb buttons, but then I don't generally use those on the desktop, mainly in games like Q3  :Smile: 

----------

## atac

okey, both my scroll wheel and thumb button works now,

tho the scroll wheel isn't as smooth as it was when X was handling it.

is there a way to set the "smoothness" in imwheel ?

Logitech Mouseman Dualoptical (6 buttons):

```
xmodmap -e "pointer = 1 2 3 6 4 5"

imwheel -k

```

----------

## Ard Righ

 *atac wrote:*   

> is there a way to set the "smoothness" in imwheel ?

 

 Have you tried the 'Resolution' setting for XF86Config ?

```
"Option" "Resolution" "3000"
```

 Or something similar depending on what works for your mouse....

----------

## atac

 *Ard Righ wrote:*   

> 
> 
>  Have you tried the 'Resolution' setting for XF86Config ?
> 
> ```
> ...

 

isn't that for the cursor ? i want to adjust the smoothness for the scroll wheel.

when scrolling now it goes like 30 lines, and when xfree was handling the scrolling it went 5-10 lines.

read on the forums about using imwheel -k -b "56", tho it dosen't work, been trying all sorts of combinations.

----------

## atac

 *wHAcKer wrote:*   

> i think i solved it, damn, the feeling that you're beginning to understand a linux system rules 

 

yeah, it's better then sex

hrm, or is it?  :Razz: 

----------

## Ard Righ

 *atac wrote:*   

> i want to adjust the smoothness for the scroll wheel.

 

 You would have to read through the docs for imwheel, I have no idea since I don't use it.

----------

## atac

well i finally solved it, heh.

restarting X and it was working  :Embarassed: 

----------

## FxChiP

This doesn't seem to work for me

I have my IntelliMouse Optical plugged into the USB port, and I'm using HID in the kernel. The stupid thing is that no matter what I try, /dev/input/mouse0 never shows up but /dev/mouse does. Only my wheel button and left and right buttons seem to work (cat /dev/mouse does not show anything when I click the left or right side buttons or if I move the wheel). 

Should I be using usbmouse? Would that affect the kernel's mouse resolution (set via the "input core" section)?

----------

## Ard Righ

 *FxChiP wrote:*   

> I have my IntelliMouse Optical plugged into the USB port, and I'm using HID in the kernel. [snip]
> 
> Should I be using usbmouse? Would that affect the kernel's mouse resolution (set via the "input core" section)?

 

 I am going to just throw some ideas out here, and someone can hopefully correct me if I am wrong, but....

 First off, I think USB HID for the mouse causes most problems for configuring a USB mouse. I use the /dev/usbmouse for my Intellimouse, and it picked it up straight away. I didn't bother with HID at all.

 HID also seems to be aimed more at the usage of USB Hubs, rather than single devices.

 Also, as far as I am aware, the resolution you set in the kernel regarding usb devices is more aimed at pen tablets, setting the resolution the pen tablets will be at (thus normally set the resolution to what you have your normal desktop resolution at).

----------

## pi-cubic

i found out something for all you guys having 2 mice and problems with the xmodmap command 

```
xmodmap -e "pointer = 1 2 3 6 7 4 5"
```

it's important to take a look at your XF86Config file at the following lines:

```
Section "ServerLayout"

Identifier       "Simple Layout"

Screen          "UXGA Display"

InputDevice    "intellimouse"   "CorePointer"

InputDevice    "touchpad"       "SendCoreEvents"

InputDevice    "mm_keyboard"    "CoreKeyboard"

EndSection
```

you have to select your "CorePointer" to your external USB mouse! if not, xmodmap doesn't recognize the correct number of buttons and it fails to load the xmodmap command above (you'll get an errormessage that your device has only 3 buttons or something).

good luck!

----------

## FxChiP

 *Ard Righ wrote:*   

> 
> 
>  Also, as far as I am aware, the resolution you set in the kernel regarding usb devices is more aimed at pen tablets, setting the resolution the pen tablets will be at (thus normally set the resolution to what you have your normal desktop resolution at).

 

No; it's meant for normal mice too. Try setting it sometime and you'll see a difference (I did). It makes the mouse slightly smoother, especially in that resolution. That's what I've heard about it.

Yeah, usbmouse is probably the way to go. I'll try that now.

----------

## FxChiP

Dear frickin' god, it didn't work for two reasons:

a.) My BIOS sucks at rerouting USB mouse signals to PS/2 accurately (i.e. discards characters that a three-button mouse doesn't typically make)

b.) I was using OHCI when my USB bus/hub/whatever was UHCI

I can use HID with it, probably usbmouse too (but I had to have that turned off so HID would be built in). 

The key to it was understanding that Linux can do all of the mouse crap on it's own without BIOS help, since it has the understanding of the protocol built in and all... 

*grins* It all works again. I may as well throw away my PS/2 converter. (the edges of it got bent one day...)

----------

## FxChiP

This is EXTREMELY STUPID, but I *THINK* I have the reasoning behind "ZAxisMapping '6 7'"

X, for some reason, doesn't like it when the last two buttons aren't the wheel, so it disregards them or something.

You set xmodmap -e "pointer = 1 2 3 6 7 4 5" to make X read 4 and 5 (the REAL mouse wheel) as 6 and 7 (the mouse wheel as defined to X). This effectively routes the real wheel to X's definition. X doesn't care much about the "4 and 5" thumb buttons, so those get routed to 6 and 7 where they belong. 

Enter imwheel. Somehow, it gets access to X. However, because of the xmodmap, "4 and 5" are read as 6 and 7. imwheel -b 67 makes imwheel think that 6 and 7 (remember that the thumb buttons are considered extra by X and took up the 4 and 5 space before being routed back to their rightful 6 and 7 spot) mean up and down. Since X considers the thumb buttons to be active (since they're buttons, but not handled directly by X), it happily passes them along to imwheel as 6 and 7. 

It's a matter of making both of them think the wheel is somewhere it isn't... and yet is. Yet it's required because X chops off 6 and 7 since they don't seem to serve any particular purpose (while for the ZAxisMapping 6 and 7, X has to keep 4 and 5 so that it doesn't screw up). 

The reason some of you are having the "thumb buttons scroll up and down" problem is because you missed a step. You set the ZAxisMapping to 6 and 7, but for some reason xmodmap isn't running or you don't have it set to run. This makes the thumb buttons scroll (most likely). 

I could most definitely be wrong, but this is how I think it works.

BTW: this is how the config file provided with imwheel gets broken. That config file isn't written to do the actions it contains on an up and down event, which is what's required for the IntelliMouse (Explorer/Optical) to work correctly. 

It IS kind of a hack, I see that now.

----------

## nickc

Followed all this info but I can't for the life of me get the back and forward buttons to work  :Sad: 

I have the MS Interlimouse Optical (Not the big explorer one). This has  the normal left and right buttons a centre scroll wheel and two back and forward buttons on the side.

If we count the scroll button as two (Up and down) then I hve 6 buttons. It is PS/2.

XF86Config

Identifier  "Mouse1"

    Driver      "mouse"

    Option "Protocol"    "ExplorerPS/2"

    Option "Device"      "/dev/mouse"

    Option "Buttons" "6"

    Option "ZaxisMapping" "5 6"

    Option "Resolution" "1200" 

I am using the xmodmap line:

xmodmap -e "pointer = 1 2 3 6 4 5"

Where am I going wrong? The scroll works just not the back and forward buttons.

I am testing this in Firebird and in GNOME Nautils just browsing files.

Any help _much_ appreciated!

Nick

----------

## pYrania

you've got 7, the wheel is pressable.

----------

## chiatello

this is great, thanks man   :Cool: 

----------

## Ard Righ

 *pYrania wrote:*   

> the wheel is pressable.

 

Commonly referred to as "mouse3" in most computer software.

----------

## nickc

 *pYrania wrote:*   

> you've got 7, the wheel is pressable.

 

Thanks, I have now set XF86Config like this:

Identifier  "Mouse1"

    Driver      "mouse"

    Option "Protocol"    "ExplorerPS/2"

    Option "Device"      "/dev/mouse"

    Option "Buttons" "7"

    Option "ZaxisMapping" "6 7"

    Option "Resolution" "1200" 

And issued the command:

 xmodmap -e "pointer = 1 2 3 6 7 4 5" 

But still no back and forward buttons in Firebird or Nautils  :Sad: 

Do I need to set Firebird and Nautils up or something or is it my XF86Config/xmodmap?

Thanks for the help  :Smile: 

----------

## pYrania

uhm i just noticed you're right.

this worked some time ago, but i never used this (appart from testing if it works)

dunno why it doesn't work anymore. I am sure there was no xmodmap update since then, has to be another problem.

----------

## nickc

 *pYrania wrote:*   

> uhm i just noticed you're right.
> 
> this worked some time ago, but i never used this (appart from testing if it works)
> 
> dunno why it doesn't work anymore. I am sure there was no xmodmap update since then, has to be another problem.

 

Hmmm, there has to be a soloution somewhere? What setup are you using?

----------

## pYrania

same as yours.

----------

## nickc

Right, I have noticed that using this setup my two side buttons are both functioning as "left click". This sounds like it's simply  problem with mapping them to back and forward rather than left click.

Does anyone know how I can do this?

Thanks

----------

## cereal-chiller

Has anybody manage to get this to work with gtk2 aplications?

The buttons work with Xmms, but they dont with nautilus and Mozilla-1.4 (gtk2 apps)....

----------

## ruronikenshin83

For some reason, the compile flags that you use for imwheel seem to play a hand in whether or not it works well...

I had to step down from -march to -mcpu 

(basically exactly what was written in defaults for /etc/make.conf)

And even then I still had to add:

```
exec imwheel -k -p -f -b "67" &
```

to get it to work

----------

## neocui

I got it working in nautilus and mozilla 1.4 by recompiling imwheel with CFLAGS="-mcpu=i686 -O2 -pipe"

----------

## Bytal

Cereal: GTK2 apps have had some probs picking up the imwheel signals. What I had to resort to was to change my .imwheelrc to 

```

"(null)"

None, Up, Alt_L|Left

                                                                                

None, Down, Alt_L|Right

```

So that overrides any other settings unfortunately (ie u can only use the buttons as Alt_L + Right) but also clobbers gtk2 into actually picking up the signals. And its not much of a prob becuase most apps agree on this key combo for back and forth movement, if its applicable.

----------

## solarium_rider

For those of you who prefer to make things nice an elegant, if you start imwheel w/ the line:

```
imwheel -k -b "000067"
```

And then just edit your ~/.imwheelrc (it appears to overide the global one, so you don't have to touch that) to have: 

```
"^Mozilla.*"

None,   Thumb1, Alt_L|Left,     1,

None,   Thumb2, Alt_L|Right,    1,

```

Using the Thumb1 and Thumb2 identifiers makes in more intuitive (for me anyways.)  

This will make sure it only works in Mozilla as well (which is a GOOD THING if you play a lot of games.)  

   -Chris

----------

## derlauer

all my buttons are working but my problem is that the wheel up/down is switched with the two side buttons. so if i press a side button the window scrolls up or down.

mouse: microsoft intelli optical

xf86config: 

```
     Identifier  "Mouse1"

     Driver      "mouse"

     Option      "Protocol" "ExplorerPS/2"

     Option      "Device" "/dev/input/mice"

     Option      "Buttons" "7"

     Option      "ZAxisMapping" "6 7"

     Option      "Resolution" "1200"
```

/etc/x11/gdm/sessions/gnome: 

```
xmodmap -e "pointer = 1 2 3 6 7 5 4"
```

----------

## cvt

I'm using a MS Exporer mouse...

I'm wanting to map the 2 side buttons  to programs.. like.

Through all apps, I want the big button to launch "3ddesk" and the small button to be the enter key (works)

when running winex I want the big button to be "p" (or oter games aswell)

is that possible?

----------

## pi-cubic

 *derlauer wrote:*   

> all my buttons are working but my problem is that the wheel up/down is switched with the two side buttons. so if i press a side button the window scrolls up or down.
> 
> mouse: microsoft intelli optical
> 
> xf86config: 
> ...

 

you might want to check ur xmodmap line, it should be: xmodmap -e "pointer = 1 2 3 6 7 4 5". take a look at the last 2 digits!

----------

## cca93014

Ok, I have things finally working now. Was very confused as to why it wasn't working until I realised that Firebird was running with gtk2. Currently my .imwheelrc file reads:

```
"(null)"

None, Up, Alt_L|Left

None, Down, Alt_L|Right

                                                                                

"^MozillaFirebird"

None, Up, Alt_L|Left

None, Down, Alt_L|Right

                                                                                

"^xmms"

None, Down, Z

None, Up, B

```

I have two questions:

In windows I have the scroll-wheel-press action configured to go "Back" in the browser. Is this possible with imwheel or just natively through X (I am under the assumption that imwheel is only manageing the left and right side buttons)?

Can I speed up the scroll action, so a single scroll click up or down scrolls more "lines" of text in MozillaFirebird?

Thanks,

Ben

----------

## opello

This is a great thread  :Smile:   Should be added to the docs.

For people having the side buttons scroll (it's been mentioned a few times, as has the solution) all you have to do is change the 'pirority' of the devices (set the intellimouse as the "CorePointer" and the 'other pointers' (for me my laptop's trackpad/pointer stick) as "SendCoreEvents")

i've yet to do the imwheel stuff, but my wheel works with that information --

for scroll speed - i know normal mozilla has that in the prefs > advanced > mouse wheel, but i dunno about firebird (i would assume so)

EDIT:

imwheel isn't working, my config is:

```
cat ~/.imwheelrc

"Mozilla"

None, Thumb1, Alt_L|Left

None, Thumb2, Alt_L|Right

"^xmms"

None, Thumb1, Z

None, Thumb2, B
```

but it seems that in nano or scrolling up/dn in mozilla, it's doing a pageup or a pagedown (not the 3 lines i have set in the prefs)

how do i fix this - any ideas?

EDIT 2:

fixed, s/Thumb1/Left and s/Thumb2/Right

i dunno what the deal is, but everyone seems to use different 'symbols' for the thumb buttons, thanks to #imwheel on irc.freenode.net  :Smile: Last edited by opello on Wed Sep 03, 2003 5:24 pm; edited 1 time in total

----------

## gungter

What am I doing wrong ? I've tried everything that you've been talking here, but still my mouse's side buttons and wheel aren't working without writing the commands xmodmap and imwheel  manually. I think it must be somthing simple, but I just can't find out what it could be.

----------

## RedBeard0531

For the life of me, I cant figgure it out. Why dont they add support in apps for buttons 6 and 7?  :Evil or Very Mad:   :Evil or Very Mad:   :Evil or Very Mad:   :Evil or Very Mad:   :Evil or Very Mad:   :Evil or Very Mad: 

Then i could access it directly from the program. I realize that Xfree is based on the archaic X protocal that calls for 3 buttons, but come on! These things have been out for several years, its not some new passing fad. If Konq and Moz etc. would just nativly support unlimited (ok, mabey like 10 is resonable) buttons life would be much easier. I KNOW this is possable b/c fvwm supports unlimited (afaik) buttons natively.

--end rant--  :Cool: 

----------

## Dalcius

Just thought I'd pass along a success story.

System:

-x11-base/xfree: 4.3.0-r3

-gnome-base/gnome: 2.4

-Microsoft IntelliMouse Optical 1.0A USB and PS/2 Compatible

The easiest way I've found is to do the following:

```

/etc/X11/XF86Config:

Section "InputDevice"

    Identifier  "Mouse1"

    Driver      "mouse"

    Option "Protocol"    "ExplorerPS/2"

    Option "Device"      "/dev/usbmouse"

    Option "Buttons"    "7"

    Option "ZAxisMapping"       "6 7"                                                                                                                           

    Option "Resolution" "1200"                                                                                                                                    

EndSection

/etc/X11/Xmodmap (you'll probably have to create this):

pointer = 1 2 3 6 7 4 5

```

This sets up mapping system wide.

Hope it helps anyone who's still stuck.

----------

## BackSeat

Anyone using a Microsoft Wireless Optical Mouse 2.0?

I was using an Intellimouse, and that worked fine. I used the middle button (ie, clicking the wheel) in Galeon to open a link in a new tab. The Wireless Optical Mouse works fine too, but the middle button doesn't always work. One difference between the two mice is that the original Intellimouse has detents on the wheel whereas the Optical Mouse doesn't: it is a smooth rolling action.

It seems to me that the wheel can sometimes be in a position where, for some reason, X doesn't recognise the middle button down event (although xev seems to see them OK). Hmm, thought just occurs to me: this mouse has the tilting wheel, so perhaps I'm inadvertently tilting the wheel when I click. Has anyone configured a tilting wheel to work under X?

BS

----------

## Schizoid

 *BackSeat wrote:*   

> Anyone using a Microsoft Wireless Optical Mouse 2.0?
> 
> I was using an Intellimouse, and that worked fine. I used the middle button (ie, clicking the wheel) in Galeon to open a link in a new tab. The Wireless Optical Mouse works fine too, but the middle button doesn't always work. One difference between the two mice is that the original Intellimouse has detents on the wheel whereas the Optical Mouse doesn't: it is a smooth rolling action.
> 
> It seems to me that the wheel can sometimes be in a position where, for some reason, X doesn't recognise the middle button down event (although xev seems to see them OK). Hmm, thought just occurs to me: this mouse has the tilting wheel, so perhaps I'm inadvertently tilting the wheel when I click. Has anyone configured a tilting wheel to work under X?
> ...

 

I just came home the other day with the "Microsoft Optical Wireless Desktop Elite" which includes a fancy keyboard and mouse. 

I have xbindkeys in use for all the special keyboard keys and that works like a charm. I am however having trouble getting the two extra buttons (Nine total!) working on the mouse.

7 buttons work fine, but when I try to add in the other two I get confused very quickly!

In my XF86Config-4 file I have total buttons set to 9 and the z axis mapping set to 8 9. Then for xmodmap I have pointer 1 2 3 4 5 8 9 6 7 and -b 89 on imwheel.

This doesn't work of course :-p. The wheel seems to be hilighting text or something lol, and the 2 new buttons are not doing anything. The back/forward buttons are scrolling up and down. Back goes up and forward goes down.

Trying to figure this out is making my head spin.

Also while I am here....I would like to bind two keyboard keys to do back/forward in the browser. So I need to bind a key with xbindkeys to Alt L and Alt R. Anyone aware of a way to do something like this?

Thank you for any help here.

----------

## Blackace

Schizoid:

Run xev from the terminal and go through, pressing all your buttons, look for ButtonRelease events and see what "button #" it says for each one.

This is before you've done any xmodmap stuff.

Then ZAxisMapping should be set to whatever buttons your scroll wheel actually is before xmodmap has changed things.

Now, if your scroll buttons are actually (before xmodmap) something other than 4 and 5 (like 8 and 9 for instance), you need to use xmodmap to make them 4 and 5:

```
xmodmap -e "pointer = 1 2 3 8 9 6 7 4 5"
```

Or something to that effect, basically you want to assign 8 to 4 and 9 to 5, which are the buttons most applications look to for scrolling input.

Now in a completely separate process, you use imwheel to make special buttons like back and forward work, by having imwheel handle buttons 6,7,8,9 which are actual buttons 6,7,4,5.

Remember that the xmodmap command above has CHANGED what numbers correspond to what buttons, so:

```
xmodmap -e "pointer = 1 2 3 8 9 6 7 4 5" (Change)

            pointer = 1 2 3 4 5 6 7 8 9  (After Change)

                      | | | | | | | | |

               Left <-+ | | | | | | | |

                        | | | | | | | |

               Middle <-+ | | | | | | |

                          | | | | | | |

                  Right <-+ | | | | | |

                            | | | | | |

                Scroll Up <-+ | | | | |

                              | | | | |

                Scroll Down <-+ | | | |

                                | | | |

                      Special <-+-+-+-+
```

And also remember that imwheel and the button numbers you use with it are entirely separate from scrolling or what is in ZAxisMapping.

Basically these are the things that have helped me understand how it all works.

Blackace.

----------

## mawst

This is great info. Simply edited my xf86config and added the line to my ~/.xinitrc and BOOM! mouse4 and mouse5 are now availbel to me. Great in Jedi Academy for swicthing force powers.

Cheers!

-mawst

----------

## Schizoid

 *Blackace wrote:*   

> Schizoid:
> 
> Run xev from the terminal and go through, pressing all your buttons, look for ButtonRelease events and see what "button #" it says for each one.
> 
> This is before you've done any xmodmap stuff.
> ...

 

Ok this is a bit odd.

Here is my mouse setup:

```

Section "InputDevice"

    Identifier "Mouse1"

    Driver "mouse"

    Option "Protocol" "ExplorerPS/2"

    Option "Device" "/dev/usbmouse"

    Option "Buttons" "9"

    Option "ZAxisMapping" "6 7"

    Option "Resolution" "200"

EndSection

```

Now I have commented out the xmodmap and imwheel lines in my xfce init file and when I run xev I get:

Wheel up = 6

Wheel down = 7

Back button = 4

Forward button = 5

The two extra buttons on my new mouse are used by pushing the scroll wheel side to side. So you can push it left to scroll left, right for right.

When I push them in xev I get what looks like a keyboard button press.

```

KeyPress event, serial 27, synthetic NO, window 0x1200001,

     root 0x40, subw 0x0, time 246211, (102,111), root:(612,130),

     state 0x00, keycode 196 (keysym 0x0, NoSymbol), same_screen YES,

     XLookupString gives 0 bytes: ""

```

I get the same keycode when I do it left & right too.

Now I use xbindkeys to bind all those crazy keys on my keyboard and I suppose if it really thinks this is a keyboard key I can bind it with xbindkeys. But it seems to be one one key??

A bit confusing!

I am going to turn imwheel back on now before I kill myself trying to use the scroll wheel.

Thank you for your help, any idea what is going on here?

----------

## Diezel

I don't know what I have done wrong here but this is the drill. I get everything vorking smoothly but both side buttons on the Intellimouse Explorer 3 scroll the webpage upwards!??

Everything is set up acording to the tips so it skould work.

I even had it working before my hardisk went to heaven and I had to reinstall.

Any tips here?

----------

## Number6

It took me a while to figure this out...

For those of us who prefer KDE, the xinitrc file is found in /etc/X11/xinit

Slowly but surely, i'm getting the hang of this.

Here are all my settings in case this helps anyone else out. (I have a Dell 8200 Inspiron with a MS Intellimouse USB explorer and the mouse, mousewheel, side buttons, touchpad and pointer all work all the time.)

/etc/X11/xinit/xinitrc

```

#!/bin/sh

# $Xorg: xinitrc.cpp,v 1.3 2000/08/17 19:54:30 cpqbld Exp $

userresources=$HOME/.Xresources

usermodmap=$HOME/.Xmodmap

xinitdir=/usr/X11R6/lib/X11/xinit

sysresources=$xinitdir/.Xresources

sysmodmap=$xinitdir/.Xmodmap

# merge in defaults and keymaps

if [ -f $sysresources ]; then

    xrdb -merge $sysresources

fi

if [ -f $sysmodmap ]; then

    xmodmap $sysmodmap

fi

if [ -f $userresources ]; then

    xrdb -merge $userresources

fi

if [ -f $usermodmap ]; then

    xmodmap $usermodmap

fi

#Scroll wheel Stuff

exec imwheel -k -b "67" &

# First try ~/.xinitrc

if [ -f "$HOME/.xinitrc" ]; then

        XINITRC="$HOME/.xinitrc"

        exec /bin/sh "$HOME/.xinitrc"

# If not present, try the system default

elif [ -n "`/etc/X11/chooser.sh`" ]; then

        exec "`/etc/X11/chooser.sh`"

# Failsafe

else

        # start some nice programs

        twm &

        xclock -geometry 50x50-1+1 &

        xterm -geometry 80x50+494+51 &

        xterm -geometry 80x20+494-0 &

        exec xterm -geometry 80x66+0+0 -name login

fi

```

/etc/X11/Xmodmap

```

pointer = 1 2 3 6 7 4 5

```

/etc/X11/XF86Config

```

Section "InputDevice"

     Identifier     "Mouse1"

     Driver         "mouse"

     Option "Protocol"     "ExplorerPS/2"

     Option "Device"     "/dev/input/mice"

     Option "Buttons" "7"

     Option "ZAxisMapping" "6 7"

EndSection

Section "InputDevice"

    Identifier     "Touch Pad"

    Driver         "mouse"

    Option         "Device"         "/dev/psaux"

    Option         "Protocol"       "GlidePointPS/2"

    Option         "ZAxisMapping"   "4 5"

    Option         "Emulate3Buttons"

    Option         "CorePointer"    "true"

EndSection

```

More 

/etc/X11/XF86Config

```
   

    InputDevice "Mouse1" "CorePointer"

    InputDevice "Keyboard1" "CoreKeyboard"

    InputDevice "Touch Pad" "SendCoreEvents"

```

Also, /home/usernamehere/.Xmodmap

```

pointer = 1 2 3 6 7 4 5

```

----------

## opello

sorta off topic here - buti also have an inspiron 8200, and was wondering if you have scrolling or any touchpad special stuff working?

i'm told the new synaptics driver has some alps support, but haven't heard from anyone that's tried it yet

----------

## Number6

I never used the "special" touchpad stuff. I just want it to move the mouse and have the buttons work, which they do. (Altho tapping the pad does do a left-click)

They way I have it now, the touchpad works, the pointer stick works and the USB mouse all work at the same time and I can hotplug and unplug the mouse and it works all the time, which is what I was after. Plus I got the scrollwheel on the mouse working and the back/forward side mouse buttons are working.

If you're interested, drop me a PM and I'll send you copies of my config files.

----------

## r4d1x

ok, ive got imwheel running, (had to run it from /etc/X11/Sessions/enlightenment)  but now scrolling down with the mouse whll scrolls up, and up still scrolls up.  anyone know how to fix this?  the thumb buttons still act as mouse1 and mouse2.  

#!/bin/sh

/usr/bin/enlightenment

xmodmap -e "pointer = 1 2 3 6 7 4 5 "

imwheel -k -p -b "67"

any ideas?

----------

## r4d1x

well, now the scroll wheel doesnt work and the left and right side buttons act like the scroll wheel.  i changed the xmodmap from 1 2 3 6 7 4 5 to 1 2 3 4 5 6 7.

ideas?

----------

## oldsk00l

hmm, strange, but when I add it to my /etc/X11/Sessions/Gnome file, it doesn't work.

I don't think I am adding it correctly, exactly what is it suppose to look like inside the script.

----------

## opello

i had problems with imwheel unless i padded it with zeroes, so here's my line from xinitrc:

```
imwheel -k -b 000067
```

when you do 000067 the 'symbols' as i call them for the buttons are "Thumb1" and "Thumb2" making it a little more intuitive, as well as explicitly disabling imwheel's capturing of other button events (at least is my understanding)

i'm still using

```
xmodmap -e "pointer = 1 2 3 6 7 4 5" &
```

in my xinitrc however ...

----------

## Nitsuj

I can't for the life of me get it to work automatically at boot. I can get my mousewheel working and my side buttons going front and back in Mozilla, but I have to type in the commands manually everytime I boot up. I've tried edting /etc/X11/Sessions/kde-3.2.2 as follows:

```
#!/bin/sh

xmodmap -e "pointer = 1 2 3 6 7 4 5"

imwheel -k -b "67"

/usr/kde/3.2/bin/startkde
```

I've added exec in front of the commands, but nothing seems to work. When I boot my mousewheel just highlights text and my side buttons scroll until I type those commands in the console.

I even tried editing my /etc/X11/xinit/xinitrc as someone else reccomended, but that doesnt work either. I'm still new to Gentoo/Linux, so if anyone can please tell me how the hell to get those commands to be passed automatically at boot i would REALLY appreciate it.

----------

## numerodix

I'm having trouble getting an external usb mouse to work on a laptop. The touchpad is running fine, xfree config is identical to the one here apart from the print out below: https://forums.gentoo.org/viewtopic.php?t=105524

I also have an MS Explorer mouse that I've been using on my stationary computer and I've copied the config and put it in XF86Config like so:

```

Section "InputDevice"

     Driver "synaptics"

     Identifier "Mouse1"

     Option "Device"    "/dev/input/event0"

     Option "Protocol"  "event"

     Option "LeftEdge"  "0"

     Option "RightEdge" "6000"

     Option "TopEdge"   "0"

     Option "BottomEdge"        "6000"

     Option "FingerLow" "25"

     Option "FingerHigh"        "30"

     Option "MaxTapTime"        "180"

     Option "MaxTapMove" "220"

     Option "VertScrollDelta" "100"

     Option "MinSpeed"  "0.07"

     Option "MaxSpeed"  "0.22"

     Option "AccelFactor"       "0.0004"

     Option "SHMConfig" "on"

     Option "EdgeMotionSpeed" "0"

     Option "SHMConfig" "on"

     Option "EdgeMotionSpeed" "0"

EndSection

Section "InputDevice"

    Identifier      "USBmouse"

    Driver      "mouse"

    Option "Resolution"  "1680"

    Option "Protocol"    "ExplorerPS/2"

    Option "Device"      "/dev/usbmouse

    Option "Buttons"     "7"

    Option "ZAxisMapping" "6 7"

EndSection

"Section "ServerLayout"

# The Identifier line must be present

        Identifier      "Server Layout"

        Screen          "Screen0"

        InputDevice     "Mouse1"        "SendCoreEvents"

        InputDevice     "Mouse1"        "CorePointer"

        InputDevice     "USBmouse"

        InputDevice     "Keyboard1"     "CoreKeyboard"

EndSection
```

The mouse doesn't work at all in X. I have a bunch of usb modules compiled and use hotplug to load them, dmesg shows no errors my mouse is recognized by model. I also have both the mouse and the touchpad working with gpm, setting proto to imps2 and device to /dev/usbmouse.

If someone is using an external usb mouse, maybe you could show me your config?

# cat /proc/config.gz | gunzip | grep HID

# USB Human Interface Devices (HID)

CONFIG_USB_HID=m

CONFIG_USB_HIDINPUT=y

# CONFIG_HID_FF is not set

CONFIG_USB_HIDDEV=y

# USB HID Boot Protocol drivers

# lsmod

Module                  Size  Used by

fglrx                 207876  7 

firmware_class          7936  0 

hostap                 76556  0 

8139cp                 16512  0 

usbhid                 31108  0 

snd_intel8x0           30468  0 

snd_ac97_codec         62596  1 snd_intel8x0

snd_pcm                86308  1 snd_intel8x0

snd_timer              21892  1 snd_pcm

snd_page_alloc          9348  2 snd_intel8x0,snd_pcm

snd_mpu401_uart         6400  1 snd_intel8x0

snd_rawmidi            20384  1 snd_mpu401_uart

snd_seq_device          6792  1 snd_rawmidi

snd                    47460  7 snd_intel8x0,snd_ac97_codec,snd_pcm,snd_

d_mpu401_uart,snd_rawmidi,snd_seq_device

ehci_hcd               37896  0 

uhci_hcd               29976  0 

intel_agp              16412  1 

agpgart                28072  2 intel_agp

evdev                   7808  1 

rtc                    10552  0 

usbcore               106292  5 usbhid,ehci_hcd,uhci_hcd

battery                 8076  0 

ac                      3596  0

----------

## tujz

maybe i missed it, but how do you set the side buttons to whatever you want?

when i had windows i liked to set them to minimize and close

in gentoo, i think id like to try putting one to close and one to switch workspaces

----------

## Spiffster

I've seen a couple of questions regarding /etc/X11/Xmodmap in this thread. However, I've not seen anyone answer the question. With Gnome and GDM this seems to be non-functional.

I've been messing with this both for keyboard and mouse configuration. Although it is probably possible to make it work with some local (user) configuration, I would like to use the system-wide approach. 

Does anyone have an explanation of why Gnome does not use /etc/X11/Xmodmap anymore. I have verified that it is indeed loaded from the gdm startup scripts, but there must be something loaded in the users profile, that disables this.. Hmm..

I guess it can be found somewhere in /etc/skel as well, since I have just installed the machine.

Update: Hmm. It seems the pointer-remapping works fine from /etc/X11/Xmodmap, but keyboard remappings do not. I guess this is offtopic then.

/Spiff

----------

## Hivemind

hitting a brick wall here...

Explorer optical v 1.1 7 button.

xev only sees the standard 3 buttons

the xf86config file mouse snippet:

```
Section "InputDevice"

    Identifier  "Mouse1"

    Driver      "mouse"

    Option "Protocol"    "ExplorerPS/2"

    Option "Device"      "/dev/usbmouse"

    Option "Buttons"    "7"

    Option "ZAxisMapping"       "6 7"                                          $

    Option "Resolution" "1200"

EndSection

```

the bottom of the global xinitrc file:

```
xmodmap -e "pointer = 1 2 3 6 7 4 5"

imwheel -k -b "67" -p &
```

xev doesn't see a thing beyond the 3rd button

USB port connected, mouse works normally otherwise

kernel 2.6.7 R10 Kde 3.2.3

help.

----------

## The_Fang

Its not working..... at least the xmodmap is not. I dont know why, but imwheel seems to be working.

I'using Gentoo Linux 2.6.7-gentoo-r11 with Xorg and KDE 3.2.2.

Please say me in which file i gotta write what stuff. I tried every file you guys recommended and is existent in my system. I even created some of the files but it still doesn't work  :Sad: 

When I type that stuff in manually wheel works.

EDIT:

I just realized that the wheel works on the KDE-Desktop. I am able to switch between the work-screens (Arbeitsfläche) by scrolling the wheel. However, the wheel still does not work in applications like Firefox or Konqueror.

----------

## timbo

Here is something odd... I've got an Intelliemouse exploder and have set it up like this thread taks and it's worked fine for ages, including thumb buttons.

I've recently moved to kernel version 2.6.7-gentoo-r11 from running 2.4 kernel versions.  Now the mouse works great BUT it's sooooo slow, move it left right up down and it's like the accel is way down, the same for all WM's fluxbox, KDE etc...

Has anyone had this happen.  I put psmouse_resolution=200 into my grub config file but when the kernel boot's it disregards that command.

Regards

Tim

 :Cool: 

----------

## tad

 *BackSeat wrote:*   

> Anyone using a Microsoft Wireless Optical Mouse 2.0?
> 
> I was using an Intellimouse, and that worked fine. I used the middle button (ie, clicking the wheel) in Galeon to open a link in a new tab. The Wireless Optical Mouse works fine too, but the middle button doesn't always work. One difference between the two mice is that the original Intellimouse has detents on the wheel whereas the Optical Mouse doesn't: it is a smooth rolling action.
> 
> It seems to me that the wheel can sometimes be in a position where, for some reason, X doesn't recognise the middle button down event (although xev seems to see them OK). Hmm, thought just occurs to me: this mouse has the tilting wheel, so perhaps I'm inadvertently tilting the wheel when I click. Has anyone configured a tilting wheel to work under X?
> ...

 

Check out my post here:

https://forums.gentoo.org/viewtopic.php?t=198534

----------

## cyon

Ok followed alll the directions as supplied previoulsy in this forum even went so far as to try the imwheel option...

The scroll will only work with "4 5" set refuses to work if I set it as "6 7" . Havent tried using the extra buttons yet.

Here's my Xorg:

Section "InputDevice"

    Identifier  "Mouse1"

    Driver      "mouse"

    Option "Protocol"    "ExplorerPS/2"

    Option "Buttons" "7"

    Option "Device"      "/dev/mouse"

    Option "ZAxisMapping" "4 5"

#    Option "Resolution"        "100"

----------

## sprite

between the orig and 2nd post i got it working =) thanks a bunch, and tag for future refrence...

----------

## floppes

After a few hours of playing around I finally got it working!  :Smile: 

Thanks for all the info on this thread!

I am using KDE 3.3.2 and a Microsoft IntelliMouse Optical and also had the problem that the commands in the xinitrc and other files were not executed correctly (or KDE reset the settings).

Ok, this is how it works for me:

First, install imwheel with

```
# emerge imwheel

```

Files:

/etc/X11/xorg.conf (I use Xorg, if you use XF86 this is /etc/X11/XF86Config)

```
Section "InputDevice"

   Identifier  "intellimouse"

   Driver      "mouse"

   Option      "Buttons" "7"

   Option      "Protocol" "ExplorerPS/2"

   Option      "Device" "/dev/usbmouse"

   Option      "ZAxisMapping" "6 7"

EndSection

```

Because I have a laptop, the external mouse must be the CorePointer:

```
Section "ServerLayout"

   Identifier     "X.org Configured"

   Screen      0  "Screen0" 0 0

   InputDevice    "intellimouse" "CorePointer"

   InputDevice    "Keyboard0" "CoreKeyboard"

   InputDevice    "touchpad" "SendCoreEvents"

EndSection

```

This file is automatically executed after you log in to KDE:

/home/myloginname/.kde/Autostart/setup_mouse (file must be executable)

```
#!/bin/sh

xmodmap -e "pointer = 1 2 3 6 7 4 5" &

imwheel -k -b "67" &

```

/etc/X11/imwheel/imwheelrc

```
".*"

None, Up, Control_L|C

None, Down, Enter

```

----------

## Karim

This worked fine in .bashrc:

```
xmodmap -e "pointer = 1 2 3 6 7 4 5"
```

----------

## WillRiker

 *Knight wrote:*   

> After doing long periods of searching through various mailing lists I've found a perfect configuration setup for the Microsoft IntelliMouse Optical that allows the use of all 5 buttons (the 3 buttons and the 2 side ones) along with the wheel and even got the side buttons to recognize as mouse4 and mouse5 in games. First you need to do these changes/additions to your /etc/X11/XF86Config file:
> 
> ```
> Section "InputDevice"
> 
> ...

 

Tnx for the work but i can't get it to work

I get the error that buttons 7 is not allowed.

The code xmodmap won't work either  :Sad: 

Am i overlooking something

----------

## kwisatz

After working just fine for ages, my intellimouse suddenly  decides to drop both scroll and thumb button funtionality. This happened after a rather large world update emerge, and frankly I'm not sure what could have coused this.

Apparently now only 3 buttons on the mouse are recogniced.

```

/usr/X11R6/bin/xmodmap -pp

There are 3 pointer buttons defined.

    Physical        Button

     Button          Code

        1              1

        2              2

        3              3

```

Now I have this in /etc/X11/Xmodmap:

```

pointer = 1 2 3 6 7 4 5

```

and this entry in /etc/X11/XF86Config-4:

```
 

    Identifier  "Mouse1"

    Driver "mouse"

    Option "Protocol"   "ExplorerPS/2"

    Option "Device"     "/dev/psaux"

    Option "Buttons" "7"

    Option "ZAxisMapping" "6 7"

```

Should work right? If I try to feed xmodmap mappings for 7 buttons manually it gives me this error:

```

/usr/X11R6/bin/xmodmap -e "pointer = 1 2 3 6 7 4 5"

/usr/X11R6/bin/xmodmap:  commandline:0:  bad number of buttons, must have 3 instead of 7

/usr/X11R6/bin/xmodmap:  1 error encountered, aborting.

```

What gives? Why won't xmodmap accept more that 3 buttons?

----------

## beissemj

I have the same problem, i get the error 3 message, and I can't figure out why...  I'll look at it some more tomorrow and let ya know what i come up with.

-beissemj

 :Confused: 

----------

## beissemj

 *kwisatz wrote:*   

> After working just fine for ages, my intellimouse suddenly  decides to drop both scroll and thumb button funtionality. This happened after a rather large world update emerge, and frankly I'm not sure what could have coused this.
> 
> Apparently now only 3 buttons on the mouse are recogniced.
> 
> If I try to feed xmodmap mappings for 7 buttons manually it gives me this error:
> ...

 

kwisatz that is very strange indeed.  Like I said before I had the same problem, but have since gotten my mouse to work.  Obviously, once you changed ur xorg.conf or in your case (/etc/X11/XF86Config-4) you need to restart X so it knows about the new mouse configuration (duh).

The other thing I had to do was emerge udev.  udev, to my understandingy, is a protocal for identifying devices on your system. (http://www.gentoo.org/doc/en/udev-guide.xml)  The problem I think i was having was devfs not correctly identifying my mouse so it was loading a dummy configuration.  In any case it works now, and those are the only two things I did.

Give that a shot and let me know what happens.

-beissemj[url][/url]

----------

## aqua26

I have a very simple Logitech Optical PS/2 wheel Mouse. 

from which my wheel is not working.

i am using xorg

This is my listing or /etc/X11/xorg.conf

```
Section "InputDevice"

# Identifier and driver

    Identifier  "Mouse1"

    Driver      "mouse"

    Option "Protocol"    "PS/2"

    Option "Device"      "/dev/psaux"

    Option "Emulate3Buttons" "true"

    Option "ZAxisMapping" "4 5"

    Option "Buttons" "3"

# Mouse-speed setting for PS/2 mouse.

#    Option "Resolution"        "256"

```

But still my mouse is not working

----------

## SmokyMcPot

I have an IntelliMouse Explorer and made myself a /etc/init.d/intellimouse 

```
#!/sbin/runscript

# Copyright 1999-2005 Gentoo Foundation

# Distributed under the terms of the GNU General Public License v2

# $Header: $

start() {

   ebegin "Activating IntelliMouse Explorer Features"

   xmodmap -e "pointer = 1 2 3 6 7 4 5"

   imwheel -k -b "67"

   eend $?

}

```

then I did a

```
chmod +x /etc/init.d/intellimouse

/sbin/depscan.sh

rc-update add intellimouse default
```

Now, when booting into gentoo I get an error

 *Quote:*   

> xmodmap: unable to open display ''
> 
> INFO: imwheel started (pid=6631)
> 
> could not open display, check shell DISPLAY variable, and export or setenv it!

 

The mouse-wheel isn't working and the buttons 3, 4 and 5 aren't working, too.

If I do these to command manually in gnome-terminal after booting, everything is allright and the mouse-wheel is working.

----------

## Arainach

You can't run those commands before starting X.  Instead of making it an /etc/init.d service, edit your .xinitrc or your GDM/KDM session file for your Window Manager and add those commands.  For GDM, it's the files in /usr/share/xsessions/

----------

## SmokyMcPot

I added it to ~/.xinitrc, that doesn't works (command seems not to be executed, although it's before "exec gnome-session").

I added it to ~/.xmodmap and when gnome starts I get an message that this will not be used and I should use keyboard-settings. But I can't find any solution?

Could someone give me a hint, please?

Here is my ~/.xinitrc:

```
exec modmap -e "pointer = 1 2 3 6 7 4 5" &

exec imwheel -k -b "67" &

exec gnome-session
```

----------

## drivingsouth

I've got my IntelliMouse Explorer 3.0 working now. Wheel works and the two thumbbuttons work. But there is a strange thing: When I press the on of buttons for example "back" in a webbrowser it goes back one page in the history. When it now reaches the end of the history (i.e the back button in the browser becomes grey and inactive) , a link of the page is choosen and called. The same thing happens when I use the buttons in Konqueror. When the end of the history is eached, a button press just selects one file after another. 

It whould be nice if there is no action in case the end of the history is reached.

my /etc/X11/imwheel/imwheelrc looks as follows:

```

".*"

None, Up, Alt_L|Left

None, Down, Alt_L|Right

```

----------

## ILLWILLMD

I am new, and this is m first post, but i had something important to add to this discussion.   i have done the proccess of elimination deal on the xmodmap pointer numbers and now have a key as to what the function of these numbers and there placement means.   this project took about an hr. but with all the guessing that has been afoot i thought this info would be of interest to most of you.   now i am brand spanking new to Linux and have been learning at a good rate. i can program in basic and VB, and some HTML, but thats about it. i want to learn C, C++, Pearl, Java, and the like. but anyway back to the topic.

i am running Ubuntu 7.10, and my "/etc/X11/xorg.conf" consists of:  (some lines removed for space consideration)

*********************************************************************************

# xorg.conf (xorg X Window System server configuration file)

Section "Files"

EndSection

Section "InputDevice"

	Identifier	"Generic Keyboard"

	Driver		"kbd"

	Option		"CoreKeyboard"

	Option		"XkbRules"	"xorg"

	Option		"XkbModel"	"pc105"

	Option		"XkbLayout"	"us"

EndSection

Section "InputDevice"

	Identifier	"Configured Mouse"

	Driver		"mouse"

	Option		"CorePointer"

	Option		"Device"	"/dev/input/mice"

	Option		"Protocol"	"ImPS/2"

	Option		"ZAxisMapping"	"4 5"

	Option		"Emulate3Buttons"	"false"

EndSection

Section "ServerLayout"

	Identifier	"Default Layout"

  screen 0 "Default Screen" 0 0

	Inputdevice	"Generic Keyboard"

	Inputdevice	"Configured Mouse"

EndSection

*********************************************************************************

As far as the xmodmap numbers here we go

the actual physical buttons are as follows, and are consistant with the position. i.e. (xmodmap -e "pointer = 1 2 3 4 5 6 7 8 9 ").

1 = left mouse button.

2 = thumb button.

3 = right mouse button.

4 = scroll up.

5 = scroll down.

6, 7, 8, 9 = nothing whatsoever.

------------------------------------------------------

the function of the numbers are as follows.

1 = left button click.

2 = scroll lock.

3 = context menu (normal right click).

4 = scroll up once (as opposed to scroll lock).

5 = scroll down once (as opposed to scroll lock).

6 = back.

7 = forward.

8, 9 = nothing whatsoever.

------------------------------------------------------

i have mine set to:

xmodmap -e "pointer = 1 6 3 4 5 2 7 8 9 "

----------

