# howto hotplug a USB Mouse and get it automagically work in X

## faz

We'll, the subject says it all, i guess. My USB Mouse works great in Xfree86 4.2.1-r2 on my Inspiron 8000 notebook... but only when I startup with the USB Mouse allready plugged in or after I do a CTRL-ALT-Backspace. What I really want is to plug in the mouse en have it work immediately in X. I've been searching the forums and the Net for hours, but I can't find it.

I do get the following in my log after I plug in:

```

hub.c: USB new device connect on bus1/1, assigned device number 2

input0,hiddev0: USB HID v1.10 Mouse [Logitech USB-PS/2 Optical Mouse] on usb1:2.0

```

Any help is very, very welcome!!

----------

## xr31Daisy

I've got the same kind of config ( i8200 + ms optical USB mouse ), and it works fine. Sometimes, the USB autodetection doesn't work on the first try? All I have to do is unplug it, and plug it in again.

Here's my XF86Config :

http://www.franchini.info/XF86Config

These are the 'interesting' sections :

```

Section "InputDevice"

    Identifier   "USBMouse"

    Driver   "mouse"

    Option "Protocol"    "IMPS/2"

    Option "Device"      "/dev/input/mice"

    Option "Emulate3Buttons" "off"

    Option "ZAxisMapping" "4 5"

EndSection

Section "ServerLayout"

    Identifier  "Simple Layout"

    Screen "Screen 1"

# Each InputDevice line specifies an InputDevice section name and

# optionally some options to specify the way the device is to be

# used.  Those options include "CorePointer", "CoreKeyboard" and

# "SendCoreEvents".

    InputDevice "Mouse1" "CorePointer"

    InputDevice  "USBMouse" "AlwaysCore"

    InputDevice "Keyboard1" "CoreKeyboard"

EndSection

```

----------

## pilla

Do you have hotplug installed in your notebook?

----------

## faz

Thanks xr31Daisy!!

I found the problem. I was using /dev/input/mouse0 instead of /dev/input/mice. It's working like a charm now.   :Very Happy:   :Very Happy: 

----------

## Inf7

I have the same mouse as Faz had above but that fix didn't help me out.  My mouse doen't work in X at all and I am starting to run out of ideas on how to get this thing working.

I have had one hell of a time getting USB to run on my Sony Vaio and once I get it running X is saying that it can't find my mouse protocol.  I tried the config that xr31Daisy posted and many other configs and still to no avail my mouse wont work in X.

I have cat'ed /dev/input/mice and I got the screen full of junk so the mouse is working.  I must be missing one small thing for this puzzle to be solved.

What protocol should I use for the same kind of mouse as Fez?

Thanks in advance!

Ps I have abused the search on the forum and I had to give in and post. <3 u mods ^^

----------

## faz

Could you list you're USB modules (lsmod) or, if compiled into the kernel, the relevant .config entries.

----------

