LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 11-22-2008, 01:33 AM   #1
sameer.nalawade
LQ Newbie
 
Registered: Nov 2008
Posts: 5

Rep: Reputation: 0
Detecting the keyboard and mouse


Hello guys,
i am writing a c program to detect the keyboard and mouse. In fact i am doing it right now by reading the file /proc/bus/input/devices. Program is working with few exceptions.
First problem is if you remove ps2 mouse or keyboard there is no change in /proc/bus/input/devices so it is still showing mouse and keyboard is connected when it is not. It works fine with USB Keyboard and mouse though.(it works ps2 but needs system reboot only then /proc/bus/input/devices file reflects changes.)
Second i am looking for the string "mouse" and "keyboard" in this file(obviously bad idea). For some keyboards and mice there is no string "mouse" and "keyboard" in the entry NAME:<name of device> .
so i am looking for some way i can do it without using string comparison and which works for ps2.
i am using 2.6.21-1.3194.fc7.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Detecting mouse / keyboard connectivity tthtlc Linux - Newbie 1 08-29-2007 02:19 AM
Cat over Keyboard detecting software everal General 2 12-29-2006 03:44 AM
Having trouble detecting Apple MacBook's USB-HID Keyboard joetheprogrammer Slackware - Installation 3 07-09-2006 08:03 PM
USB KEYBOARD AND MOUSE not detecting in redhat linux 9 yvgr_reddy Linux - Hardware 1 11-30-2005 03:45 PM
not detecting keyboard or mouse on install jon_currell Linux - Software 3 03-18-2001 11:29 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 12:40 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration