[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: detecting devices



On Sat, Mar 30, 2002 at 06:37:33PM -0800, sangeetha wrote:
| hi,
|     is there anyway to detect whether devices(keyboard
| and mouse) are connected to system or
| not.........using c or assembly code on linux platform
| if so plz do let me know how we can do that.thanx in
| advance.

PS/2 keyboards "just work".  I don't know of any device file to access
it, the kernel just gets the input and delivers it properly.  If the
plug is in, it is there.  What kind of mouse do you have?  If it is
serial or PS/2, just look at the plug to see if it is in.  To get data
from it, read from /dev/psaux for PS/2 and /dev/ttyS[012] for serial
(use which ever serial port it is plugged into).  For USB, check /proc
to see if the usb system recognized it and has a driver for it.

HTH,
-D

-- 

Do not be afraid of those who kill the body but cannot kill the soul.
Rather be afraid of the One who can destroy both soul and body in hell.
        Matthew 10:28


-- 
To UNSUBSCRIBE, email to debian-user-request@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org



Reply to: