# HOWTO: Logitech MX1000 with PS/2 and xorg 6.8.2

## unixj

I spent literally hours reading all the Logitech MX1000 threads and I couldn't find anything that was exactly right for my situation (PS/2 port and xorg 6.8.2) so I hope this helps someone.  Everything works for me now- including horizontal scrolling.  I'm reproducing it here as a public service.

In /etc/X11/xorg.conf

```
Section "InputDevice"

    Identifier  "Mouse1"

    Driver      "mouse"

    Option      "Protocol" "evdev"

    Option      "Dev Name" "PS2++ Logitech MX Mouse"

    Option      "Dev Phys" "isa0060/serio1/input0"

    Option      "Device" "/dev/input/event0

    Option      "Buttons" "12"

    Option      "ZAxisMapping" "9 10 11 12"

    Option      "Resolution" "800"

EndSection
```

~/.xbindkeysrc

```
"xvkbd -xsendevent -text "\[Alt_L]\[Left]""

m:0x10 + b:9

"xvkbd -xsendevent -text "\[Alt_L]\[Right]""

m:0x10 + b:10
```

~/.kde/Autostart/mousefix.sh (you can call this whatever you want)

```
#!/bin/sh

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

xbindkeys
```

And make the above executable

```
chmod +x ~/.kde/Autostart/mousefix.sh

```

Note that you need to emerge xvkdb and xbindkeys if you haven't already.  Also note that in the above I've swapped the side middle button with the mousewheel middle-click button because it's incredibly frustrating to use the latter and I copy and paste all the time.  If you prefer the default behavior swap the 8 and 2 above.

To get horizontal scrolling in Firefox you need to set the following in the Firefox about:config

```
mousewheel.horizscroll.withnokey.action    0

mousewheel.horizscroll.withnokey.sysnumlines   true
```

Alternatively you can leave sysnumlines as false and set mousewheel.horizscroll.withnokey.numlines.Last edited by unixj on Mon Feb 06, 2006 3:49 am; edited 1 time in total

----------

## dpetka2001

does this also work for MX3100 set aswell??

----------

## unixj

 *dpetka2001 wrote:*   

> does this also work for MX3100 set aswell??

 

I assume so, but I don't know for sure...  Give it a shot!

----------

## WladyX

Did you patch your kernel or are you using a vanilla or gentoo kernel?

----------

## unixj

vanilla-sources (2.6.14.2)

----------

## WladyX

 *unixj wrote:*   

> vanilla-sources (2.6.14.2)

 

That's interesting because without patching my kernel i wasn't able to get the side middle button and the tilt clicks to work. Anyway thanks for the reply.

@dpetka2001: It worked for me (after patching my kernel).

----------

## dpetka2001

which kernels need patching?? i am using 2.6.12...and where can i find the patch??

----------

## WladyX

 *dpetka2001 wrote:*   

> which kernels need patching?? i am using 2.6.12...and where can i find the patch??

 

Read more info here, if you have any problems i'll try to help you.

----------

## dpetka2001

i have read that topic and had some trouble trying to make it work...so the patch is the same...i will try to follow the instructions suggested in this topic and will post back if i run into any problems...

----------

## WladyX

 *dpetka2001 wrote:*   

> i have read that topic and had some trouble trying to make it work...so the patch is the same...i will try to follow the instructions suggested in this topic and will post back if i run into any problems...

 

i had to edit the patch a little (delete nitro-stuff) so it would match my kernel. The lines that had --- /usr/src/linux-2.6.12-nitro4/drivers/input/mouse/logips2pp.c became --- /usr/src/linux-2.6.12/drivers/input/mouse/logips2pp.c

----------

## unixj

 *WladyX wrote:*   

>  *unixj wrote:*   vanilla-sources (2.6.14.2) 
> 
> That's interesting because without patching my kernel i wasn't able to get the side middle button and the tilt clicks to work. Anyway thanks for the reply.
> 
> @dpetka2001: It worked for me (after patching my kernel).

 

Yeah weird, I am definitely not using any patches.  Maybe the patches are for the evdev driver- I'm using the normal mouse driver with Buttons and ZAxisMapping as mentioned above.

----------

## WladyX

I tried your configuration, but it didn't work, the side middle button didn't show up in xev, nor did the tild buttons, but after patching the kernel all the buttons worked.

----------

## dpetka2001

so the patch is only for nitro-kernels and has to be edited when used for gentoo-sources?? how would i do that?? edit logips2pp.diff with some editor??

----------

## WladyX

 *dpetka2001 wrote:*   

> so the patch is only for nitro-kernels and has to be edited when used for gentoo-sources?? how would i do that?? edit logips2pp.diff with some editor??

 

Yes to both questions  :Smile: 

----------

## dpetka2001

maybe that was why when i followed the instructions of the other topic nothing happened aswell...anyway i'm starting with compiling right away and keep my fingers crossed that all goes well this time...if i need any help i hope someone can help me here...thanks...

----------

## dpetka2001

where does the .xbindkeysrc relie in...i cannot find it...if i have to create it where should i put it?? in which directory?? in the /home or somewhere else??

----------

## WladyX

 *dpetka2001 wrote:*   

> where does the .xbindkeysrc relie in...i cannot find it...if i have to create it where should i put it?? in which directory?? in the /home or somewhere else??

 

Yes you have to create it in your homedir.

----------

## unixj

 *dpetka2001 wrote:*   

> where does the .xbindkeysrc relie in...i cannot find it...if i have to create it where should i put it?? in which directory?? in the /home or somewhere else??

 

Yes that goes in /home/$user.  You also have to create /home/$user/.kde/Autostart/mousefix.sh.

But I'm not sure this is going to work for you.  Maybe for MX3100 you need to follow that other thread that WladyX mentioned.

----------

## dpetka2001

i can't get it to work...i followed the instructions to the letter but couldn't get the desired result...first i patched my kernel and then compiled it with event interface support built in the kernel...then emerged xvkbd and xbindkeys, edited my xorg.conf and put those lines suggested by you in the mousefix.sh...is this the right order i should do it?? i did reboot into the new compiled kernel after compiling it...anything else i should do??

----------

## Kovid

Incidentally, the patch for the MX1000 has made it into gentoo-sources-2.6.15

----------

## dpetka2001

i am using 2.6.14-r5 the latest stable one...is there any need to patch this kernel??

----------

## Kovid

yes

----------

## dpetka2001

i did patch it...did you see 2 posts above where i describe the order i did things?? do you think it is the right order??

----------

## Kovid

Yeah seems to be the right order...but like I said before, I could never get it to work with X 6.8.2. I had to switch to modular X

----------

## dpetka2001

WladyX seems to have done it using xorg 6.8.2 as i can understand from his posts...do you think i should go to modular xorg myself?? is it safe enough??

----------

## unixj

 *dpetka2001 wrote:*   

> i can't get it to work...i followed the instructions to the letter but couldn't get the desired result...first i patched my kernel and then compiled it with event interface support built in the kernel...then emerged xvkbd and xbindkeys, edited my xorg.conf and put those lines suggested by you in the mousefix.sh...is this the right order i should do it?? i did reboot into the new compiled kernel after compiling it...anything else i should do??

 

I think there are 2 threads being mixed up here.  If I were you I would probably ignore this thread and follow the one WladyX mentioned above.  I didn't need to patch my kernel but I'm only using the MX1000 not the MX3100- maybe that is the difference.

----------

## dpetka2001

ok thank you...will do...

----------

## WladyX

 *Kovid wrote:*   

> Incidentally, the patch for the MX1000 has made it into gentoo-sources-2.6.15

 

So there is no need for patching the 2.6.15?

 *dpetka2001 wrote:*   

> WladyX seems to have done it using xorg 6.8.2 as i can understand from his posts...do you think i should go to modular xorg myself?? is it safe enough??

 

I have the stable xorg (6.8.2) and a patched gentoo-sources-2.6.14.

----------

## Kovid

 *WladyX wrote:*   

> 
> 
> So there is no need for patching the 2.6.15?
> 
> 

 

Yup.

----------

## Mith

Hey,

since it's a MX1000 related problem I figured I could post in here..

I'm running xorg 6.8.2 and the mouse works fine with kernel 2.6.14-r2 [gentoo-sources]. I tried updating the kernel to 2.6.15 and all of a sudden X is not able to initalize the mouse anymore. I checked the output of 

```
cat /proc/bus/input/devices
```

 Besides the fact that the actual name of the device changed, there was no difference. (same physical adress, same event number)

The problem I have now is, that the mouse is supposed to run under event0. However when I have a look into "/dev/input/" there is no such event listed... the only event there would be event3 (which does not work when I try that one in xorg.conf) 

Does anybody have an idea what specifically changed from kernel 2.6.14 to 2.6.15 in terms of events etc.?? I'm at a loss   :Embarassed: 

----------

## float-

Next time, post someting like this in "Documentation, Tips & Tricks", as this is not a support forum.

----------

## dpetka2001

WladdyX could you help me with more instructions on how you made it to work?? are you using only the MX1000 or the MX3100 set?? if you don't mind have a look at 2 posts above where i described the order i did things and tell me what you think...thanks...

----------

## WladyX

 *dpetka2001 wrote:*   

> WladdyX could you help me with more instructions on how you made it to work?? are you using only the MX1000 or the MX3100 set?? if you don't mind have a look at 2 posts above where i described the order i did things and tell me what you think...thanks...

 

I have a mx3100 set, does xev or evtest detect all the buttons?

----------

## dpetka2001

 *WladyX wrote:*   

> I have a mx3100 set, does xev or evtest detect all the buttons?

 how would i do that?? could you be more specific because i am new to this?? thanks...

----------

## WladyX

i don't recall now from where i downloaded evtest (but you can search the forum), xev comes with xorg, so you run xev in a terminal, you select the new window that pops out and you start pressing the buttons on your mouse, if it detects all of them than this is good, if you press some buttons and nothing scrolls on the terminal than...well...not good  :Smile: . Do this simple test and than we'll see. Good luck.

----------

## dpetka2001

WladyX i am using gentoo-sources 2.6.14 right now...so the logips2pp.diff should be 

```
--- /usr/src/linux-2.6.14/drivers/input/mouse/logips2pp.c   2005-07-16 

05:09:48.000000000 +0200

+++ /usr/src/linux-2.6.14/drivers/input/mouse/logips2pp.c   2005-08-07 

13:26:04.000000000 +0200

@@ -73,6 +73,8 @@ static psmouse_ret_t ps2pp_process_byte(

             input_report_key(dev, BTN_BACK, (packet[2] >> 3) & 1);

             input_report_key(dev, BTN_FORWARD, (packet[2] >> 4) & 1);

             input_report_key(dev, BTN_TASK, (packet[2] >> 2) & 1);

+            if (packet[2] == 32) input_report_rel(dev, REL_HWHEEL, -1);

+            if (packet[2] == 64) input_report_rel(dev, REL_HWHEEL, 1);

 

             break;

 

@@ -216,6 +218,9 @@ static struct ps2pp_info *get_model_info

       { 61,   PS2PP_KIND_MX,               /* MX700 */

             PS2PP_WHEEL | PS2PP_SIDE_BTN | PS2PP_TASK_BTN |

             PS2PP_EXTRA_BTN | PS2PP_NAV_BTN },

+      { 66,   PS2PP_KIND_MX,               /* MX3100 */

+            PS2PP_WHEEL | PS2PP_SIDE_BTN | PS2PP_TASK_BTN |

+            PS2PP_EXTRA_BTN | PS2PP_NAV_BTN | PS2PP_HWHEEL },

       { 73,   0,         PS2PP_SIDE_BTN },

       { 75,   PS2PP_KIND_WHEEL,   PS2PP_WHEEL },

       { 76,   PS2PP_KIND_WHEEL,   PS2PP_WHEEL },

@@ -241,8 +246,10 @@ static struct ps2pp_info *get_model_info

    int i;

 

    for (i = 0; ps2pp_list[i].model; i++)

-      if (model == ps2pp_list[i].model)

+      if (model == ps2pp_list[i].model) {

+                   printk(KERN_WARNING "logips2pp: Detected logitech mouse model %d\n", model);

          return &ps2pp_list[i];

+      }   

 

    printk(KERN_WARNING "logips2pp: Detected unknown logitech mouse model %d\n", model);

    return NULL;

@@ -353,16 +360,18 @@ int ps2pp_init(struct psmouse *psmouse, 

          }

 

       } else {

-

          param[0] = param[1] = param[2] = 0;

          ps2pp_cmd(psmouse, param, 0x39); /* Magic knock */

          ps2pp_cmd(psmouse, param, 0xDB);

-

-         if ((param[0] & 0x78) == 0x48 &&

-             (param[1] & 0xf3) == 0xc2 &&

-             (param[2] & 0x03) == ((param[1] >> 2) & 3)) {

-            ps2pp_set_smartscroll(psmouse, psmouse->smartscroll);

-            use_ps2pp = 1;

+         if (model == 66) {

+             use_ps2pp = 1;

+         } else {

+             if ((param[0] & 0x78) == 0x48 &&

+            (param[1] & 0xf3) == 0xc2 &&

+            (param[2] & 0x03) == ((param[1] >> 2) & 3)) {

+                ps2pp_set_smartscroll(psmouse, psmouse->smartscroll);

+                use_ps2pp = 1;

+             }

          }

       }

    }

```

right?? it is located in usr/src/linux...for patching the kernel i should do 

```
cat logips2pp.diff | patch -pX (where X is a number until it doesn't give me any errors until having been patched)
```

correct?? and then compile and reboot to the new kernel...

----------

## WladyX

I think it's ok, just patch it, if it patches ok, then build it, install it and reboot in it.

----------

## dpetka2001

ok did the patching, recompiled the kernel and rebooted into it...i changed the xorg.conf the mouse section as following

```
# Identifier and driver

    Identifier                "MX1000"

    Driver                    "mouse"

    Option "Protocol"         "evdev"

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

    Option "ZAxisMapping"     "9 10 11 12"

#    Option "SendCoreEvents"

    Option "Buttons"          "12"

    Option "Dev Name"         "PS2++ Logitech MX Mouse"

    Option "Dev Phys"         "isa0060/serio1/input0"

    Option "Resolution"       "800"
```

what else should i do next?? should i test the buttons using xev or first do the xmodmap and .xbindkeysrc thing?? and if you don't mind could you be a little more specific about the xmodmap and .xbindkeysrc thing?? finally which setup did you follow?? the one mentioned in this post or the other mentioned in the topic about Logitech MX3100?? thanks...

----------

## dpetka2001

@WladyX i would really need a piece of help whenever you have time taking a look at this topic...thanks in advance...

----------

## WladyX

 *dpetka2001 wrote:*   

> @WladyX i would really need a piece of help whenever you have time taking a look at this topic...thanks in advance...

 

When i'll get home i'll post my configs, but in the meantime you can try xev and tell me how that went.

----------

## dpetka2001

well had no luck with tha patched driver...xev couldn't recognize all of the buttons...it only detected "right/middle/left click" and no more...i unpatched the kernel, rebuilt it and now i am able to use most of the buttons using xmodmap...i cannot get horizontal scrolling and control cruise button to work...any help with these please?? also what do i need to do in order to configure the keyboard's multimedia buttons aswell?? thanks...

----------

## dpetka2001

anyone??

----------

## norc

The problem is, IMHO, that Xorg-x11 6.8 has no event support.

That it is capable is just caused by a nasty hack, which does not work entirely. (It does not work for me at all)

So try the 6.8.99.15-r4

----------

