# Microsoft Tilt Wheel Mice in X

## tad

UPDATE: xorg-x11-6.7.0-r2 has evdev patched in by default, so step 4 may be unnecessary for some users.

I just got my Microsoft tilt wheel mouse (Cordless Optical Mouse 2.0) to 

work in Xorg! Here's how:

1) The HID-input device driver doesn't have the capability to register the side-to-side tilt, so you'll have to apply the patch listed on this LinuxQuestions thread. The author says it applies to 2.6.6 kernels, but it patched fine in 2.6.7 for me.

2) Before you recompile your kernel, make sure evdev is either built-in or compiled separately as a loadable module. It's under Device Drivers --> Input Device Support --> Event interface.

3) Recompile and reinstall your newly patched kernel, then reboot. If everything's working, pressing the tilt wheel left/right during a

```
cat /dev/input/eventX
```

 (where X is the event handler for your mouse) will result in garbage in the terminal, just like any other mouse function. Find the right eventX and remember it for later.

4) Xfree86 users will want to skip this step, since it's already been patched with evdev.

Extract CheshireCat's patched Xorg ebuild into your PORTDIR_OVERLAY. You can find the link in this thread. The ebuild hasn't been updated to version r1, however, so I copied the following code to line 640 in the r1 ebuild found in portage:

```
    epatch ${FILESDIR}/xfree-linux-evdev.patch

    epatch ${FILESDIR}/xfree-linux-evdev-keyboard.patch

    epatch ${FILESDIR}/xfree-4.3.99.16-linux-evdev-mouse.patch
```

Save the edited ebuild into your overlay dir, do a

```
ebuild xorg-x11-6.7.0-r1.ebuild digest
```

and emerge xorg-x11.

5) Use the following settings in your xorg.conf/XF86Config:

```

Section "InputDevice"

    Identifier   "Mouse1"

    Driver "mouse"

    Option "Protocol"   "evdev"

    Option "ZAxisMapping"   "4 5 6 7"

    Option "Device"     "/dev/input/event1" #cat the various eventX files to find the right one

    Option "Buttons" "7"

    Option "Dev Phys" "usb-*/input0" # find this line in your /proc/bus/input/devices

EndSection

```

6) Start up Xorg. You can use xmodmap or imwheel to map the tilt wheel to different functions.

Hope this helps some people out!

----------

## _puck_

Hello tad. 

I was very happy to find your posting and went to the next store, to buy the mouse, I wanted to have since Feburar this year.

Unfortunatly I can't get it to work. 

I tried various combinations. In xev I never ever get respones for the tilt wheel. So all the other buttons work just fine. Do you have any suggestions for me.  If I cat the event-device I get some output, when pressing the tilt wheel. 

```

Section "InputDevice"

     Identifier         "Mouse0"

     Driver             "mouse"

     Option             "Protocol"   "evdev"

     Option             "ZAxisMapping"   "4 5 6 7"

     Option             "Device"     "/dev/input/event1" 

     Option             "Buttons" "7"

     Option             "Dev Phys" "usb-0000:00:11.2-2/input0" 

EndSection

```

```

Section "InputDevice"

     Identifier         "Mouse0"

     Driver             "mouse"

     Option             "Protocol"   "evdev"

     Option             "ZAxisMapping"   "6 7"

     Option             "Device"     "/dev/input/event1" 

     Option             "Buttons" "7"

     Option             "Dev Phys" "usb-0000:00:11.2-2/input0" 

EndSection

```

```

Section "InputDevice"

     Identifier         "Mouse0"

     Driver             "mouse"

     Option             "Protocol"   "evdev"

     Option             "ZAxisMapping"   "6 7 8 9"

     Option             "Device"     "/dev/input/event1" 

     Option             "Buttons" "9"

     Option             "Dev Phys" "usb-0000:00:11.2-2/input0" 

EndSection

```

```

Section "InputDevice"

     Identifier         "Mouse0"

     Driver             "mouse"

     Option             "Protocol"   "evdev"

     Option             "ZAxisMapping"   "8 9"

     Option             "Device"     "/dev/input/event1" 

     Option             "Buttons" "9"

     Option             "Dev Phys" "usb-0000:00:11.2-2/input0" 

EndSection

```

With the xmodmap and imwheel I have no problems, also I find, you could give examples in your howto.

Also while using the xevent device sometime my mouse stops working, only X restart can fix that. I am testing this now, using he "normal" USB device and the PS/2 device.

----------

## binaural

tough spot, puck. i've got the mouse but i'm scared to try all that shit above. there must be a cleaner way...

----------

## _puck_

As I can say, the only way is over the event interface, where you can also make ALL your extra buttons from keyboards make working. 

In theory, if your kernel has xev support, you only need to modify your xorg.conf to Point to that device. 

In praxis I did not manage to get it working ... when I have some spare time, I will check for it again.

----------

## kenyon

OK, I just got one of these mice today (the Microsoft Wireless Optical Mouse 2.0) and got it working.  By "working" I mean that vertical scrolling works, and the horizontal tilt is recognized as buttons 6 and 7, so Firefox goes back and forward using the tilt wheel.  This took a lot of searching and trial and error.

Firstly, I didn't need to do all the patching as instructed in the first post in this thread.  I'm using kernel 2.6.11-cko5-ck7, and it has the evdev option without patching.  So I configured evdev as a module, did a make modules_install, and modprobe evdev.  I didn't need to patch xorg-x11 either.  I'm using xorg-x11-6.8.2-r1.

You also don't need to cat the different eventX devices to figure out which one is your mouse.  Just cat /proc/bus/input/devices and look at the Handlers line for your mouse.  It says which event it is.  See mine for example:

```
I: Bus=0003 Vendor=045e Product=008c Version=0057

N: Name="Microsoft Microsoft Wireless Optical Mouse 1.0A"

P: Phys=usb-0000:00:1d.3-2/input0

H: Handlers=mouse0 event1

B: EV=17

B: KEY=1f0000 0 0 0 0 0 0 0 0

B: REL=1c3

B: MSC=10
```

Here is the rest of the configuration:

/etc/xorg.conf:

```
Section "InputDevice"

   Identifier  "Mouse0"

   Driver      "mouse"

   Option      "Buttons"      "7"

   Option      "ZAxisMapping" "4 5 7 6"

   Option      "Protocol" "evdev"

   Option      "Device" "/dev/input/event1"

   Option      "Dev Phys" "usb-0000:00:1d.3-2/input0"

   Option      "Emulate3Buttons" "no"

EndSection
```

I'm not using any xmodmap or imwheel.  The setup I described is how I want it, with the tilt wheel doing forward and backward in Firefox.  It's quite nice actually.

Update (20050529): With the above configuration, using the tilt wheel scrolls horizontally in Konqueror.  Nice.

Update (20050530): Note that the back/forward action is just the default in Firefox.  The wheel can actually be configured to do other things using about:config.

Update (20060326): ZAxisMapping numbers were wrong.  Fixed now.Last edited by kenyon on Sun Mar 26, 2006 10:06 am; edited 4 times in total

----------

## tad

Yeah, I started the topic before 2.6 had the tiltwheel functions fixed and X had evdev patched in by default. All that is needed now is a recent kernel and X.org install and the evdev driver listed in xorg.conf. Have fun, tiltwheelers!

----------

## rcxAsh

Hey!  That's great!  I'm trying to get it working.

However, I'm using a PS/2 connection, so the Phys setting is different for me.

The thing now.. my up and down scrolling is what triggers back and forth in Firefox.  What happened?  Is there a way that I can tell that the horizontal buttons are working?  When I cat /dev/input/event1, I can _sometimes_ see things being printed when I rock left and right.  Emphasis on the sometimes.  It doesn't always seem to register.  Up down, click, etc registers stuff immediately.  

The vertical scrolling now scrolls horizontally in my FirstClass client though!   :Very Happy:   Umm.  lol.  Now I need the vertical scrolling to go vertical.  Horizontal doesn't do anything there yet.  

I'm just using the current stable Gentoo kernel sources.  

Thanks for all your searching though!  This is great  :Smile: 

----------

## rcxAsh

Yay!  Disregard my last post!  It seems that you should use USB for your mouse instead of PS/2.  So I relocated my USB Bluetooth adapter to my USB hub and moved my mouse to the USB port.  

It works great now!  Horizontal scrolling in FireFox!  Thank you so much!  BTW, just in case it may not be clear to people, you should not copy kenyon's settings verbatim unless you have the same mouse as him.  

It wasn't obvious to me at first, so just in case anyone is as slow as me, note that you should set the Dev Phys setting to that which you see when you cat /proc/bus/input/devices.

Also, one thing that you may want to note is that different mice may need different ZAxisMapping settings.  When I copied kenyon's settings, I had my up and down scroll wheel scrolling left and right.. and my left and right scrolling up and down.  Just rearrange the the 4, 5, 6 and 7 until you get it working for you.  

Anyways.  Thank you sooo much kenyon!  I really appreciate all your hard work for us!

----------

## gaminggeek

Awsome I have been looking for this one thing will this patch work on a 2.6.11 kernel?

----------

## rcxAsh

 *gaminggeek wrote:*   

> Awsome I have been looking for this one thing will this patch work on a 2.6.11 kernel?

 

Are you using the latest Gentoo kernel?  (2.6.11-gentoo-r9)  If so, you don't need to patch anything.  Just add evdev support in your kernel.  

tad writes:

 *tad wrote:*   

> Yeah, I started the topic before 2.6 had the tiltwheel functions fixed and X had evdev patched in by default. All that is needed now is a recent kernel and X.org install and the evdev driver listed in xorg.conf. Have fun, tiltwheelers!

 

----------

## gaminggeek

ok I got it working (YAY!) now how do I change forefox that is sidescrolls rater than chages page as mentioned above?

----------

## rcxAsh

 *gaminggeek wrote:*   

> ok I got it working (YAY!) now how do I change forefox that is sidescrolls rater than chages page as mentioned above?

 

Open about:config in your browser and change:

mousewheel.horizscroll.withnokey.action to 0

mousewheel.horizscroll.withnokey.sysnumlines to true

You can use the filter to help you find it in the long list.  Type a portion of the item, such as mousewheel.horizscroll or something.

At least, that works for me.  Hope it works for you too!  It's so nice!

----------

## gaminggeek

ok now I have got it to work the only problem now is the fact that the tilt wheel is inverted....

----------

## rcxAsh

 *gaminggeek wrote:*   

> ok now I have got it to work the only problem now is the fact that the tilt wheel is inverted....

 

If it's inverted, play around with the ZAxisMapping.  For mine, I had to swap 6 and 7 to be 7 and 6.  This fixed my problem of having the tilt wheel being inverted.  Keep on flipping things around until you find one that works.  Usually, once you realize which pairs are which, then it will be easy to correct.  My ZAxisMapping is:

```
Option "ZAxisMapping" "4 5 7 6"
```

This is for: "Microsoft Microsoft Wireless Optical Desktop® 1.00" (as copied from /proc/bus/input/devices)

----------

## AwoL

How exactly do you configure Firefox's mouse wheel attributes using about:config?  I don't even know what about:config is.  Could anyone offer some assistance?

Thank you.

----------

## rcxAsh

 *AwoL wrote:*   

> How exactly do you configure Firefox's mouse wheel attributes using about:config?  I don't even know what about:config is.  Could anyone offer some assistance?
> 
> Thank you.

 

Type about:config in the address box and hit enter.  You will be brought to a list of configuration options.  

There are a lot of them, so to find what you need, type part of the item's name in the filter box.  In this case, you can type in something like mousewheel.horiz

Then change:

mousewheel.horizscroll.withnokey.action to 0

mousewheel.horizscroll.withnokey.sysnumlines to true 

This is what works for me.

----------

## AwoL

Thanks, that did the trick.

----------

## DeathAndTaxes

I used this post to get my 9-buttoned Microsoft Intellimouse Explorer 4.0, model 1004 with that "3d" mouse-wheel-rocker thingie up and running.  Everything I have gotten working so far can be found here.  Not just trying to whore my own website, but I don't want to have to edit and retype all that stuff for you guys.   :Wink: 

----------

## metalhedd

I have awireless  MS Intellimouse Explorer 2.0 with the tilt wheel. I've tried so many different suggestions but have been unable to get it working.  I followed this one and in the end X Would die complaining about not having a core pointer device. the only place my setup varies from the one in this post is the phys dev.  I have the mouse plugged in the USB port but when I cat /proc/bus/input/devices I get this:

 *Quote:*   

> I: Bus=0011 Vendor=0002 Product=0001 Version=0000
> 
> N: Name="PS/2 Generic Mouse"
> 
> P: Phys=isa0060/serio1/input0
> ...

 

the physical device address doesn't seem to be a USB device. also the name should say Microsoft Intellimouse yadda yadda yadda shouldn't it? I've been at this for 2 days. any help would be appreciated.

----------

## DeathAndTaxes

 *metalhedd wrote:*   

> ...I followed this one and in the end X Would die complaining about not having a core pointer device. the only place my setup varies from the one in this post is the phys dev.  I have the mouse plugged in the USB port but when I cat /proc/bus/input/devices I get this:
> 
>  *Quote:*   I: Bus=0011 Vendor=0002 Product=0001 Version=0000
> 
> N: Name="PS/2 Generic Mouse"
> ...

 

Do you have anything else plugged in?  It looks like you have a ps/2 mouse plugged in as well as the wireless intellimouse.  If you are running a ps/2 mouse, have you ever gotten any USB mouse to work?  It might be that your system isn't properly handling usb mouses yet, much less worrying about a wireless one.

Borrow someone's wired USB mouse and get it up and running first.  That will help eliminate a few problems.

----------

## metalhedd

there is a PS/2 Keyboard plugged in, which also shows up in the output of /proc/bus/input/devices no other mouse though.  I will try to get my wired USB Mouse working as you suggested and then come back.

----------

## bobpaul

Most of my trouble was I couldn't figure out how to get imwheel etc working. I got the buttons recognized in X (and thus in games, which you can't do with left and right scroll tap in windows!) but I couldn't get it to scroll left and right.

This wiki page helped out a lot. Got it working today, just pulled the " Alt| " out of their example .imwheelrc configs

----------

## Glasswalker

Hate to drag this post up again but.. I have a Wireless Intellimouse Explorer 2.0 and following kenyon's instructions i got the tilt wheel functions all working but now the side buttons don't work at all.. they don't even cause events in xev. i'd like to know how to get them working again if possible and how i can allocate them to forward/back in firefox since i'm used to that from winblows (recently converted linux user)

----------

## DeathAndTaxes

 *Glasswalker wrote:*   

> Hate to drag this post up again but.. I have a Wireless Intellimouse Explorer 2.0 and following kenyon's instructions i got the tilt wheel functions all working but now the side buttons don't work at all.. they don't even cause events in xev. i'd like to know how to get them working again if possible and how i can allocate them to forward/back in firefox since i'm used to that from winblows (recently converted linux user)

 

kenyon's not running any xmodmap or imwheel.  You might look into using those apps to help you in this final stretch.  I have a link in a previous post to this thread that mentions it, but here's the quick nuts and bolts out of my ~/.xinitrc:

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

/usr/bin/imwheel -f -k -b "456789" &

exec gnome-session
```

Good luck.   :Wink: 

----------

## Glasswalker

thanks but i gave up.. not sure your solution would've worked since those buttons weren't causing events to be sent... i bought a much simpler trackball with 2 buttons + normal wheel.

----------

## DeathAndTaxes

Well...Yeah, xev won't register any events unless they get defined with xmodmap (AIUI).  By default, it probably only sees 7 buttons, and the thumb buttons are like 8 and 9.

----------

## Glasswalker

oh well.. never really liked the tilt wheel much.. it's too easy to tilt it when clicking with it  :Sad:  *shrug* who needs all those buttons anyway   :Wink:   :Razz: 

----------

## mdshort

I'd like to show everyone a link that I found along time ago, and didn't notice this thread to post it.

Here is a working tutorial, explaining the proess and proper use of evdev (and getting the "Microsoft-IntelliMouse-Explorer-2.0" tilt wheel to work.

http://katze-mit-wut.azundris.com/archives/126-Microsoft-IntelliMouse-Explorer-2.0,-linux,-xemacs,-and-x.org.html

Your welcome. (posted this thread with the very mouse)

----------

## Glasswalker

very nice and complete.. thanks but i've already removed the MS mouse for a 2 button + standard scroll wheel trackball.. works better since i don't want/have space for 2 mouse pads on my desk (have never had success with my switchbox and changing keyboard/mouse... i'll have to find a svga/usb/usb one for 4 computers maybe that'll work (lotsa perceived hotplugging on the computers tho  :Sad: )

----------

## golding

 *rcxAsh wrote:*   

> Yay!  Disregard my last post!  It seems that you should use USB for your mouse instead of PS/2.  So I relocated my USB Bluetooth adapter to my USB hub and moved my mouse to the USB port.

 

Hmmmm!  The ONLY way I can connect my Comfort edition so it works, at the moment, is via PS/2 (waiting for drivers that will work on the MS receiver V3.0 USB)

I tried it anyway, and, viola!, it worked, straight up, no delays.  The only diff between mine and Kenyons setup is the Phys address and the map order (4 5 7 6).

----------

