# Simultaneous support for touchpad and external mouse in X?

## butter

Is anybody aware of a method for using both a touchpad and an external mouse under X (at the same time)?  Both devices are ps/2.

Furthermore, when I unplug my external mouse (3 button, scrollwheel), I need to shutdown X, and edit the XF86Config to comment out the Zaxis mapping and to emulate three buttons for the touchpad to work properly.  Is there a better way to do this? Dynamic reloading of the configuration file w/o restarting X?

thanks in advance.

----------

## David_Escott

making both work at the same time i dont know about but you should be able to devine multiple input devices in your config file so all you have to change is what one it uses 

Section "ServerLayout"

    Identifier  "Simple Layout"

    Screen "Screen 1"

    InputDevice "Mouse1" "CorePointer"

#  InputDevice "Touchpad1" "CorePointer"

    InputDevice "Keyboard1" "CoreKeyboard"

EndSection

then you could switch the comments. And since the keyword is CorePointer maybe there is a "SecondaryPointer" or something like that.

----------

## David_Escott

Dude X is cool check this out

actually this looks like a better tutorial http://www.ibiblio.org/pub/Linux/docs/HOWTO/mini/XFree86-Second-Mouse

It is a fairly simple process to get two or even three mice to work simultaneously in XFree86. Unfortunately you only get one mouse cursor, but that's the way it is. I think the ultimate would be to have multiple differently coloured mouse cursors which you could move independently. Note that this is not relevant for XFree86 4.0, where the authors have thoughtfully placed an example second mouse in the XF86Config file.

The mouse is defined in the XF86Config file, which for me resides in /etc/X11. This example is for a setup identical to my own, with a NetMouse on the PS/2 port, and a Microsoft serial mouse on a serial port.

Your primary mouse should be setup as normal with a Pointer section. For me, this section is

   Section "Pointer"

       Protocol    "NetMousePS/2"

       Device      "/dev/psaux"

       Buttons     5

       ZAxisMapping 4 5

   EndSection

The second mouse is defined in the XInput section. You can also add a third mouse with another Mouse subsection in the XInput section. For a Microsoft serial mouse, the settings should be

   Section "XInput"

       SubSection        "Mouse"

           Port          "/dev/ttyS0"

           DeviceName    "Pointer"

           Protocol      "Microsoft"

           Emulate3Buttons

           Emulate3Timeout 50

           AlwaysCore

       EndSubSection

   EndSection

After restarting X, you can fully appreciate the pointlessness of having multiple mice attached to a computer. 

http://www.google.com/search?q=cache:krZhyMNa3kMC:www.harshbutfair.org/software/multimice.html+XFree86+two+mice&hl=en&ie=UTF-8

off the google cache

Im gonna go out and buy me a usb mouse.

----------

## butter

To be more clear: both devices are ps/2 AND psaux.

----------

## Robelix

 *butter wrote:*   

> To be more clear: both devices are ps/2 AND psaux.

 

On my Laptop (a Fujitsu Siemens) it's not possible - if an external ps/2 mouse is plugged in the bios switches off the touchpad.

----------

## pablo_pita

First of all, this thread has allowed me to find the information to solve my problem with my touchpad & ps/2 mouse. So thanks for the posts !!!

I just followed the information given in the link given above (http://www.ibiblio.org/pub/Linux/docs/HOWTO/mini/XFree86-Second-Mouse).

My touchpad was not working when no ps/2 mouse was attached. Therefore, there was something wrong with my XF86Config-4. I read the mini-howto and then, went to fix the XF86Config-4 file. I created this entry for the touchpad:

  Section "InputDevice"

        Identifier  "PS/2 Touch Pad"

        Driver      "mouse"

        Option      "Protocol" "PS/2"

        Option      "Device" "/dev/psaux"

        Option      "Emulate3Buttons" "true"

        Option      "Emulate3Timeout" "70"

        Option      "SendCoreEvents" "true"

  EndSection

I kept this entry for my PS/2 wheel mouse:

  Section "InputDevice"

        Identifier  "PS/2 Mouse"

        Driver      "mouse"

        Option      "Protocol" "IMPS/2"

        Option      "ZAxisMapping" "4 5"

        Option      "Device" "/dev/psaux"

        Option      "Emulate3Buttons" "true"

        Option      "Emulate3Timeout" "70"

        Option      "SendCoreEvents" "true"

  EndSection

Finally, I had to setup the "ServerLayout" section to show the two mice :

  Section "ServerLayout"

	       Identifier     "XFree86 Configured"

 	       Screen      0  "Screen0" 0 0

  	       InputDevice    "Keyboard0" "CoreKeyboard"

   	       InputDevice    "PS/2 Touch Pad" "CorePointer"

    	       InputDevice    "PS/2 Mouse" "AlwaysCore"

  EndSection

By the way, I do not need to generate any dynamic configuration file ala Knoppix.

----------

## David_Escott

Butter if your bios is turning off the touchpad when you plug in the external you should be able to tell by running 

cat /dev/mouse or whatever is appropriate here. If the bios is simply mapping the external onto the touchpad you will see nothing when you use the touchpad but will see something when you use the mouse, and if the external mouse is not plugged in you will see events from the touchpad. But based on your having to close X and restart it seems that this is not what is happening and you should have 2 ps devices that you can use, if you can figure out how to set up the XF86Config properly.

----------

## pablo_pita

GRRRR ... ! 

I replied to fast ... as both my external mouse and touchpad do not work together with the configuration I posted. I did not tested it properly. 

I am trying to use the configuration generated by Knoppix, which works fine for the two mice, but it does not work for the touchpad alone. The touchpad alone works with the posted configuration, but not with both mice connected. 

So, just discard my previous email.

----------

## krt

try turning off the options "SendCoreEvents" on both of your pointer devices, everything else looks good (SendCoreEvents is the same as AlwaysCore, and should be used in the ServerLayout section, according to what I can read from the <grumble grumble> XFree86 documentation, and from what I've tested using USB and PS2 mice together)

----------

