linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Hot swapping USB mouse in X window system
@ 2003-08-17 16:38 Brandon Stewart
  0 siblings, 0 replies; 4+ messages in thread
From: Brandon Stewart @ 2003-08-17 16:38 UTC (permalink / raw)
  To: linux-kernel

My ohci adapter doesn't work on 2.4, so I can't tell if this is the 2.6 
kernel, devfsd, or configuration related. There are two facts that make 
hot swapping a USB mouse in X windows fail:

1) If a mouse is not detected at the start of X windows, that mouse will 
not be checked for during the operation of X windows.
2) If a mouse is detected at the start of X windows, then the device 
corresponding to that mouse cannot be released until X windows is stopped.

So when I start X windows without the mouse plugged in, and then try to 
plug the mouse in, X windows will not even look at it, because it threw 
away it's InputDevice section at startup. I can verify that it is 
recognized by Linux proper because a /dev/input/mouse1 device will be 
created and catting this device while moving the mouse will result in 
junk on the screen.

But when I start X windows with the mouse, unplug it, and replug it in, 
I get a different problem. What happens is that upon unplugging the 
mouse, the /dev/input/mouse1 device will stay there, whereas unplugging 
it outside of X windows results in its disappearance. So X windows is 
still listening for input from /dev/input/mouse1. But when I replug in 
the USB mouse, it doesn't attach to /dev/input/mouse1. Rather, it 
creates a new device called /dev/input/mouse2. And X windows is not 
looking at this.

I tried creating a third InputDevice section for X windows that points 
to mouse2, but it discards the configuration at startup, and so won't 
use it when it is plugged in.

I'd appreciate hearing from anyone who has experienced similar, or knows 
if there is a way to work around this.

-Brandon


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Hot swapping USB mouse in X window system
@ 2003-08-17 18:17 John Bradford
  0 siblings, 0 replies; 4+ messages in thread
From: John Bradford @ 2003-08-17 18:17 UTC (permalink / raw)
  To: linux-kernel, rbrandonstewart

> I'd appreciate hearing from anyone who has experienced similar, or knows 
> if there is a way to work around this.

Either configure X to use /dev/input/mice and create /dev/input/mice if it doesn't exist using:

mknod /dev/input/mice c 13,63

or use the virtual ps/2 device.

John.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Hot swapping USB mouse in X window system
  2003-08-17 16:48 Andrey Borzenkov
@ 2003-08-17 17:40 ` Brandon Stewart
  0 siblings, 0 replies; 4+ messages in thread
From: Brandon Stewart @ 2003-08-17 17:40 UTC (permalink / raw)
  To: Andrey Borzenkov; +Cc: linux-kernel

Ok, that works. I knew about /dev/input/mice, but I didn't use it 
because one mouse was PS/2 and the other was IMPS/2. But it appears to 
figure things out on it's own. Thanks.

-Brandon

Andrey Borzenkov wrote:

>>1) If a mouse is not detected at the start of X windows, that mouse will 
>>not be checked for during the operation of X windows.
>>2) If a mouse is detected at the start of X windows, then the device 
>>corresponding to that mouse cannot be released until X windows is stopped
>>    
>>
>
>Use /dev/input/mice, it multiplexes all mice found and exists even if no 
>device is currentrly available.
>
>Under 2.6 I can "hot-plug" serial and PS2 mouse this way and use both at the 
>same time.
>
>-andrey
>


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Hot swapping USB mouse in X window system
@ 2003-08-17 16:48 Andrey Borzenkov
  2003-08-17 17:40 ` Brandon Stewart
  0 siblings, 1 reply; 4+ messages in thread
From: Andrey Borzenkov @ 2003-08-17 16:48 UTC (permalink / raw)
  To: Brandon Stewart; +Cc: linux-kernel

> 1) If a mouse is not detected at the start of X windows, that mouse will 
> not be checked for during the operation of X windows.
> 2) If a mouse is detected at the start of X windows, then the device 
> corresponding to that mouse cannot be released until X windows is stopped

Use /dev/input/mice, it multiplexes all mice found and exists even if no 
device is currentrly available.

Under 2.6 I can "hot-plug" serial and PS2 mouse this way and use both at the 
same time.

-andrey

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2003-08-17 18:05 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-08-17 16:38 Hot swapping USB mouse in X window system Brandon Stewart
2003-08-17 16:48 Andrey Borzenkov
2003-08-17 17:40 ` Brandon Stewart
2003-08-17 18:17 John Bradford

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).