# How do I disable/ignore a hardware/mouse device? [solved]

## Chadwick

I have a touchpad in my computer, which oddly enough comes up as a "ImPS/2 Logitech Wheel Mouse".  I want to disable it.  That is, I want all touching of the touchpad to be completely ignored by my computer.  I'd settle for just X ignoring the touchpad events, but only if Wine gets its mouse events from X.  Doing this at boot-time or statically is unacceptable, so just writing some udev rule for ignoring the mouse when it's added will not cut it.  

My eventual goal is to make my touchpad stop when I plug in my usb mouse, and resume functioning when the usb mouse is unplugged.  Timing it to the usb mouse plug/unplug seems easy enough with udev rules, but I've been searching the internet for hours and hours today and can't find any information on how to make the damn devices just stop working.  

Please help!

Relevant stuff from my digging around in the console:

```
<root|/home/chad> find /sys -name dev | grep mouse

/sys/devices/platform/i8042/serio2/input/input5/mouse0/dev

/sys/devices/pci0000:00/0000:00:13.1/usb3/3-2/3-2:1.0/input/input9/mouse1/dev

<root|/home/chad> udevinfo -a -p /sys/devices/platform/i8042/serio2/input/input5/mouse0/dev

Udevinfo starts with the device specified by the devpath and then

walks up the chain of parent devices. It prints for every device

found, all possible attributes in the udev rules key format.

A rule to match, can be composed by the attributes of the device

and the attributes from one single parent device.

  looking at device '/devices/platform/i8042/serio2/input/input5/mouse0/dev':

    KERNEL=="dev"

    SUBSYSTEM==""

    DRIVER==""

  looking at parent device '/devices/platform/i8042/serio2/input/input5/mouse0':

    KERNELS=="mouse0"

    SUBSYSTEMS=="input"

    DRIVERS==""

    ATTRS{dev}=="13:32"

  looking at parent device '/devices/platform/i8042/serio2/input/input5':

    KERNELS=="input5"

    SUBSYSTEMS=="input"

    DRIVERS==""

    ATTRS{name}=="ImPS/2 Logitech Wheel Mouse"

    ATTRS{phys}=="isa0060/serio2/input0"

    ATTRS{uniq}==""

    ATTRS{modalias}=="input:b0011v0002p0005e0063-e0,1,2,k110,111,112,r0,1,8,amlsfw"

  looking at parent device '/devices/platform/i8042/serio2/input':

    KERNELS=="input"

    SUBSYSTEMS==""

    DRIVERS==""

  looking at parent device '/devices/platform/i8042/serio2':

    KERNELS=="serio2"

    SUBSYSTEMS=="serio"

    DRIVERS=="psmouse"

    ATTRS{description}=="i8042 AUX1 port"

    ATTRS{modalias}=="serio:ty01pr00id00ex00"

    ATTRS{bind_mode}=="auto"

    ATTRS{protocol}=="ImPS/2"

    ATTRS{rate}=="100"

    ATTRS{resolution}=="200"

    ATTRS{resetafter}=="5"

    ATTRS{resync_time}=="0"

  looking at parent device '/devices/platform/i8042':

    KERNELS=="i8042"

    SUBSYSTEMS=="platform"

    DRIVERS=="i8042"

    ATTRS{modalias}=="platform:i8042"

  looking at parent device '/devices/platform':

    KERNELS=="platform"

    SUBSYSTEMS==""

    DRIVERS==""

<root|/home/chad> cat /proc/bus/input/devices

... snip ...

I: Bus=0011 Vendor=0002 Product=0005 Version=0063

N: Name="ImPS/2 Logitech Wheel Mouse"

P: Phys=isa0060/serio2/input0

S: Sysfs=/devices/platform/i8042/serio2/input/input5

U: Uniq=

H: Handlers=mouse0 event5

B: EV=7

B: KEY=70000 0 0 0 0

B: REL=103

... snip ...

I: Bus=0003 Vendor=046d Product=c408 Version=0110

N: Name="Logitech USB Trackball"

P: Phys=usb-0000:00:13.1-2/input0

S: Sysfs=/devices/pci0000:00/0000:00:13.1/usb3/3-2/3-2:1.0/input/input9

U: Uniq=

H: Handlers=mouse1 event6

B: EV=17

B: KEY=1f0000 0 0 0 0

B: REL=3

B: MSC=10

```

Last edited by Chadwick on Sat May 31, 2008 6:31 am; edited 1 time in total

----------

## code933k

man synaptics  :Idea: 

Check out that SHM config in xorg.conf is on by the way.

Cheers.

----------

## defenderBG

compile your kernel without support for ps/2 mouse. (assuming you are using an external one that is usb)

----------

## pigeon768

Use /dev/input/event* rather than /dev/input/mice.

----------

## code933k

 *pigeon768 wrote:*   

> Use /dev/input/event* rather than /dev/input/mice.

 

I read there "statically is unacceptable"...

----------

## Chadwick

OK I've managed to do this, at least in a specialized way.

The first problem I had to solve was my touchpad, which is an uncommon Elantech touchpad rather than the well-supported Synaptics variety.  Fortunately, someone has been on this task and released an Elantech Touchpad driver:

http://arjan.opmeer.net/elantech/

I patched my kernel, a linux-2.6.24-gentoo-r3, and recompiled it.

The below seems to work without running it in synaptics compatibility mode.  It's maybe a bit odd, but true.  

After that I needed to set up the synaptics driver and xorg.conf.  This article was of great assistance: http://gentoo-wiki.com/HARDWARE_Synaptics_Touchpad

At this point I could execute 

```
synclient TouchpadOff=1
```

 in my shell to turn off my touchpad, as well as 

```
synclient TouchpadOff=0
```

 to turn it back on again.  That somewhat satisfies the problem I hoped to solve here.  

Now I can accomplish my even broader objective of causing my usb mouse functionality to exclude touchpad functionality by using a couple udev rules:  

```
ACTION=="add",    SUBSYSTEM=="input", ATTRS{name}=="*USB Trackball*", PROGRAM="/usr/bin/synclient TouchpadOff=1"

ACTION=="remove", SUBSYSTEM=="input", ATTRS{name}=="*USB Trackball*", PROGRAM="/usr/bin/synclient TouchpadOff=0"

```

Better can probably be done, but these work for me.  I used this as a guide: http://www.reactivated.net/writing_udev_rules.html

I was kind of hoping to learn how to turn off devices more generally.  For instance, you can write a udev rule that ignores a devices when it is plugged in, through something like OPTIONS+="ignore_device".  Maybe I am wrong about that, and ignore_device does something else.  At any rate, I never found a way to make udev ignore a device that is already plugged in.  I can't think of why I need to know how to do this; it just seems like something I should know how to do.  I'll mark this thing solved, but I'm still interested in a more general solution -- one that works for things besides touchpads.  

For reference, here is what "cat /proc/bus/input/devices" says about my touchpad:

```
I: Bus=0011 Vendor=0002 Product=000d Version=0063

N: Name="ETPS/2 Elantech Touchpad"

P: Phys=isa0060/serio2/input0

S: Sysfs=/devices/platform/i8042/serio2/input/input5

U: Uniq=

H: Handlers=mouse0 event5

B: EV=f

B: KEY=6420 7000f 0 0 0 0

B: REL=143

B: ABS=1000003

```

So yeah, code933k, "man synaptics" was a step in the right direction.

Thanks guys.

----------

## code933k

Glad to hear that. Cheers!

----------

