Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[HOW-TO] Dual-mouse (Touchpad & USB) setup on a laptop
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
Joffer
Guru
Guru


Joined: 10 Sep 2002
Posts: 585
Location: Arendal, Norway

PostPosted: Thu Oct 02, 2003 2:58 am    Post subject: [HOW-TO] Dual-mouse (Touchpad & USB) setup on a laptop Reply with quote

[HOW-TO] Dual-mouse (Touchpad & USB) setup on a laptop

Background:We've just gotten new laptops at work, so I'm installing Gentoo from scratch on my new hp nx7000. This laptop has a touchpad as most new laptops do. It also has 3 USB 2.0 ports. While I'm at the office, I use an USB mouse for most of the time, while relying on the touchpad when I'm out of office. Manually changing MOUSE and MOUSEDEV parameters in /etc/conf.d/gpm was too irritating, so I started looking into how to enable both touchpad AND my USB MS Intellimouse. And having found a solution, why not write a short HOW-TO about it :)

This is for a 2.4.xx kernel.

Table of contents
  1. HOW-TO - Console
  2. HOW-TO - XFree86
  3. Complete config files
HOW-TO - Console

You should first of all have general mouse support in console. Getting that support is beyond this short HOW-TO. If you need help getting such support, check my [HOW-TO] Mouse support in console post.

In my case, I already had mouse support in console using my touchpad (using /dev/psaux as device and ps2 as protocol in /etc/conf.d/gpm). I wanted USB mouse support as well. Reading through the man pages, educated me on the '-M' option. So this is what you should do to enable a second mouse in console:

Edit /etc/conf.d/gpm and add a second mouse device and protocol:
Code:
MOUSE2=imps2
MOUSEDEV2=/dev/input/mice

Then, further down, make a new APPEND variable, or append the new settings to the APPEND variable if you already use the variable:
Code:
APPEND="-M -m ${MOUSEDEV2} -t ${MOUSE2}"

Now, restart gpm and both mice should work (as long as you have configured the USB (mouse) support in your kernel (se my other HOW-TO - link above):
Code:
/etc/init.d/gpm restart


HOW-TO - XFree86
Most of you probably use X most of the time, so dual-mouse support here is also essential :)

Edit your XF86Config file (or XF86Config-4) and add a new InputDevice:
Code:
Section "InputDevice"
    Identifier  "USBmouse"
    Driver      "mouse"
    Option      "Protocol"  "IMPS/2"
    Option      "Device"    "/dev/input/mice"
EndSection

Then you also need to let X know you have another mouse, so we add the device to the ServerLayout:
Code:
Section "ServerLayout"
    ...
    InputDevice  "Keyboard1" "CoreKeyboard"
    InputDevice  "TouchPad"  "CorePointer"
    InputDevice  "USBmouse"  "SendCoreEvents" # we add this device
    ...
EndSection

Also add 'AllowMouseOpenFail' option to ServerFlags. This will make X start even if there is a problem with the mice.
Code:
Section "ServerFlags"
    ...
    AllowMouseOpenFail
    ...
EndSection


Complete config files (as far as mouse support goes)
I'm in the prosess of reinstalling my laptop, so these config files are taken from my backup. They might be wrong, but I believe they are correct. I will confirm this shorly. They were added as it was requested by 'Nice'.

/etc/conf.d/gpm:
Code:
# Config file for /etc/init.d/gpm

# Please uncomment the type of mouse you have and the appropriate MOUSEDEV entry

MOUSE=ps2
MOUSE2=imps2
MOUSEDEV=/dev/psaux
MOUSEDEV2=/dev/input/mice

# Extra settings

#RESPONSIVENESS=
#REPEAT_TYPE=raw

# Please uncomment this line if you want gpm to understand charsets used
# in URLs and names with ~ or : in them, etc. This is a good idea to turn on!

#APPEND="-l \"a-zA-Z0-9_.:~/\300-\326\330-\366\370-\377\""

# Various other options

#APPEND="-g 1 -A 60"
APPEND="-l \"a-zA-Z0-9_.:~/\300-\326\330-\366\370-\377\" -g 1 -A90 -S -a 30 -d 9 -M -m ${MOUSEDEV2} -t ${MOUSE2}"

/etc/X11/XF86Config:
Code:
Section "InputDevice"
   Identifier   "TouchPad"
   Driver      "mouse"
   Option      "Protocol"   "PS/2"
   Option      "Device"   "/dev/psaux"
   Option      "ZAxisMapping"   "6 7"
   Option      "Emulate3Buttons"
EndSection

Section "InputDevice"
        Identifier      "USBmouse"
   Driver          "mouse"
   Option          "Protocol"      "IMPS/2"
   Option          "Device"        "/dev/input/mice"
   Option          "ZAxisMapping"  "4 5"
EndSection

Please comment or correct my mistakes if any...

ToDo:
- Check out repeater function mentioned in this thread.
- Add findings (if any) from my 2.6.0-test9 kernel build

Changelog:
20031002 - Initial posting
20031006 - Added section about XFree86, which I forgot in my initial post. Thanks to d99ma.
20031111 - Added my config files for gpm and X. Added a simple 'Table of Contents'
20031112 - Added a short notice about this being for the 2.4.xx kernel


Last edited by Joffer on Wed Nov 12, 2003 11:44 am; edited 6 times in total
Back to top
View user's profile Send private message
Cottonee
n00b
n00b


Joined: 23 Sep 2003
Posts: 73
Location: Palmerston North, New Zealand

PostPosted: Sun Oct 05, 2003 3:35 am    Post subject: Reply with quote

Thanks Joffer :o , I can using both thinkpad mouse(PS/2) and USB mouse in console without any problem. How about in X server? I am using KDE which I would like both mouses (PS/2 and USB) to work like in the console. For now, I can only do it by changing mouse's protocol in XF86config to macth the mouse that I am going to use before start X. Is there any way that I can do it automatically without changing XFconfig everytime?

Last edited by Cottonee on Mon Oct 06, 2003 6:39 am; edited 1 time in total
Back to top
View user's profile Send private message
d99ma
Tux's lil' helper
Tux's lil' helper


Joined: 21 Jul 2003
Posts: 148
Location: Lund, Sweden

PostPosted: Sun Oct 05, 2003 6:49 pm    Post subject: Reply with quote

You need to edit XF86Config.
Add another InputDevice for your USB mouse:
Code:

Section "InputDevice"
    Identifier  "USB-Mouse"
    Driver      "mouse"
    Option      "Protocol"  "IMPS/2"
    Option      "Device"    "/dev/input/mice"
EndSection

Add the new InputDevice to your ServerLayout:
Code:

Section "ServerLayout"
    ...
    InputDevice  "USB-Mouse" "SendCoreEvents"
    ...
EndSection

Perhaps you need to add the Option "AllowMouseOpenFail" to your ServerFlags section also, can't remember right now.
Back to top
View user's profile Send private message
RedBeard0531
Guru
Guru


Joined: 21 Sep 2002
Posts: 415
Location: maryland

PostPosted: Mon Oct 06, 2003 3:34 am    Post subject: Reply with quote

Sorry to inform you that this is obsolete(or soon will be). the 2.5/6 kernels feature a better mouse naming sceme. you get /dev/input/mouseX and /dev/input/mice that is a combanation of all of them. It is a very nice solution to this.Check it out!
_________________
OH MY GOD! Kenny just killed Kenny!
That Basterd!
Back to top
View user's profile Send private message
gondoi
Tux's lil' helper
Tux's lil' helper


Joined: 27 Mar 2003
Posts: 138
Location: San Angelo, TX

PostPosted: Sat Oct 18, 2003 8:10 pm    Post subject: touchpad killed and switching mice Reply with quote

Ok, first of all, I have a problem with gpm killing my touchpad mouse when i start it while I am runing my X server. But this is really no big deal since I don't plan on using the virtual terminals too much.. (probably just use xterm or something)
Anyway, anyone heard of this happening?

BTW, I may just need to RTFM, but I'm being lazy today.

Also, Does anyone know how to make the touchpad turn off when I plug in a USB mouse? Or something similiar... maybe a script or something... I see how I could do it by changing the config file, but then that would require restarting the server.. :cry: no fun.

So, any comments would be appreciated.
_________________
"I'm only acting retarded, what's your excuse?"
- The Gord
Back to top
View user's profile Send private message
Nice
n00b
n00b


Joined: 21 Oct 2003
Posts: 3
Location: Detroit

PostPosted: Tue Oct 21, 2003 1:15 am    Post subject: Reply with quote

thanks for the HOWTO's Joffer, they helped a lot 8)

my question that would be nice to add on top of the existing howto would be: could you list your XF86Config settings for your touchpad?

as in: i got my usb mouse and my touchpad working in console (your first howto) and my USB mouse to work in X, but can not get my touchpad work in X :?
Back to top
View user's profile Send private message
paolo
l33t
l33t


Joined: 23 Jul 2002
Posts: 768
Location: SBT (AP)

PostPosted: Tue Oct 21, 2003 10:48 am    Post subject: Reply with quote

This is my solution that works both on console and under X, with or without external mouse.

/etc/conf.d/gpm :
Code:

MOUSE=imps2
MOUSEDEV=/dev/misc/psaux
APPEND="-Rraw -M -m /dev/input/mice -t imps2"


/etc/X11/XF86Config :
Code:

Section "InputDevice"
        Identifier      "gpm"
        Driver  "mouse"
        Option "Protocol"    "Imps/2"
        Option "Device"      "/dev/gpmdata"
        Option "ZAxisMapping" "4 5"
        Option "buttons" "5"
EndSection


The only difference from the initial post of this thread is that we use the repeater function of gpm to send mouse signal to X.

Paolo
_________________
Nihil sine magno labore
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum