On Tue, Apr 25, 2000 at 06:38:57PM +0530, Madhurjya P. Bora wrote:
> Hi All!
>
> Suppose in the middle of a Linux session, I have pulled out the mouse (a
> PS/2) cable. How do I detect that the mouse is no longer intact? I tried
> the following C code, but with no result. All the time the status
> remains same, whether I plug in or out the mouse cable. I also tried
> writing a BIT to the device with write, but write did not complain, even
> if mouse is no longer connected.
According to:
http://www.freebsd.org/cgi/man.cgi?query=mouse&apropos=0&sektion=0&manpath=FreeBSD+4.0-RELEASE&format=html
you just need to try reading the device. If there is a mouse, you get data,
otherwise, you get EIO.
-Arun
-----------------------------------------------------------------------
For information on this and other Linux India mailing lists check out
http://lists.linux-india.org/