Skip to contentSkip to conversation

Udev plus keyboard and mouse (fedora core 5)

DISCUSSION Nkwebi Peace 3 participants 5 messages May 8, 2006 – May 9, 2006

lore
Share & tools
lore
#0 lore raw

Hello everyone.. I need help with identifying device files for my keyboard and mouse..I am trying to write a c program to retrieve access times for my keyboard and mouse and wanted to do it using the stat() system call which require the file name for each devive file...If they is a better way to do it please help with that..The reason I am asking is because the /dev drive seems to be populated with many ttyXXX files and I can't identify which is which.. The /dev/input directory also has many files and I can't seem to locate the correct one.. I am running fedora core 5, which I understand uses udev for handling device files and their naming..

The other question I wanted to ask is whether the dynamic naming of device files also applies to the keyboard and mouse, and can one handle that in a program if device file names are not kept static using the udev rules..I am not really a fan for udev rules, though I had to use them for my external NTFS harddisk and memory stick..

Thanking you in advance...
___________________________________________________________________
For super low premiums, click here http://www.webmail.co.za/dd.pwm

http://www.webmail.co.za the South African FREE email service

-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid0709&bid&3057&dat1642
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#1 lore raw
Quoted 9 lines · Nkwebi Peace

Hello everyone.. I need help with identifying device files for my keyboard and mouse..I am trying to write a c program to retrieve access times for my keyboard and mouse and wanted to do it using the stat() system call which require the file name for each devive file...If they is a better way to do it please help with that..The reason I am asking is because the /dev drive seems to be populated with many ttyXXX files and I can't identify which is which..

Why do you care about the tty files for keyboards?

Quoted 2 lines

The /dev/input directory also has many files and I can't seem to locate the correct one..

One of them points back to your keyboard, if you have the event driver loaded. Look in /sys/class/input/ to try to figure it out.

Quoted 7 lines

I am running fedora core 5, which I understand uses udev for handling device files and their naming..

The other question I wanted to ask is whether the dynamic naming of device files also applies to the keyboard and mouse, and can one handle that in a program if device file names are not kept static using the udev rules..

You can have persistant names for input devices, as I think Debian has done that. Not sure if Fedora has or not, but if not, a few simple rule additions would do it for you.

good luck,

greg k-h

-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid0709&bid&3057&dat1642
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#2 lore raw
In reply to Nkwebi Peace

Greg, It seems when I am not in X, but I an using the keyboard and mouse, the /sys/class/input/mouseX and /sys/class/input/eventX files do not get updated.. So I was thinking the solution will be to check the console as well, and that brings me back to the first question of locating the device file names for console..

regards..

Quoted 45 lines · On Mon, 8 May 2006 11:24:49 -0700 Greg KH <[email protected]> wrote:
Quoted 2 lines · Nkwebi Peace

Hello everyone.. I need help with identifying device

files

Quoted 1 line

for my keyboard and mouse..I am trying to write a c

program

Quoted 2 lines

to retrieve access times for my keyboard and mouse and wanted to do it using the stat() system call which

require

Quoted 2 lines

the file name for each devive file...If they is a better way to do it please help with that..The reason I am

asking

Quoted 1 line

is because the /dev drive seems to be populated with

many

Quoted 1 line

ttyXXX files and I can't identify which is which..

Why do you care about the tty files for keyboards?

Quoted 1 line

The /dev/input directory also has many files and I can't

seem to

Quoted 1 line

locate the correct one..

One of them points back to your keyboard, if you have the event driver
loaded. Look in /sys/class/input/ to try to figure it out.

Quoted 1 line

I am running fedora core 5, which I understand uses udev

for handling

Quoted 3 lines

device files and their naming..

The other question I wanted to ask is whether the

dynamic

Quoted 2 lines

naming of device files also applies to the keyboard and mouse, and can one handle that in a program if device

file

Quoted 1 line

names are not kept static using the udev rules..

You can have persistant names for input devices, as I think Debian has
done that. Not sure if Fedora has or not, but if not, a few simple rule
additions would do it for you.

Quoted 3 lines

good luck,

greg k-h

___________________________________________________________________
For super low premiums, click here http://www.webmail.co.za/dd.pwm

http://www.webmail.co.za the South African FREE email service

-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid0709&bid&3057&dat1642
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#3 lore raw
In reply to Nkwebi Peace

I demand that Greg KH may or may not have written...

[snip]

Quoted 6 lines
Quoted 3 lines

The other question I wanted to ask is whether the dynamic naming of device files also applies to the keyboard and mouse, and can one handle that in a program if device file names are not kept static using the udev rules..

You can have persistant names for input devices, as I think Debian has done that. [...]

Yes. I've had to make use of them recently for a USB mouse after upgrading from X.org 6.8.2 to 7.0 - 6.8.2 was patched to allow options "Dev Phys" and "Dev Name" (using the corresponding ioctls), but that got dropped.

IR input's fine, though, since I patched LIRC locally to allow it to use the ioctls - which I prefer for this :-)

[snip]

Signature · 16 lines
| Darren Salt    | linux or ds at              | nr. Ashington, | Toon
| RISC OS, Linux | youmustbejoking,demon,co,uk | Northumberland | Army
| + Output less CO2 => avoid boiling weather.     TIME IS RUNNING OUT *FAST*.

Alimony and bribes will engage a large share of your wealth.


-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid0709&bid&3057&dat1642
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
#4 lore raw
In reply to Nkwebi Peace

A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?

A: No.
Q: Should I include quotations after my reply?

Quoted 3 lines · Nkwebi Peace

Greg, It seems when I am not in X, but I an using the keyboard and mouse, the /sys/class/input/mouseX and /sys/class/input/eventX files do not get updated..

What do you mean "not get updated"? Why would X have anything to do with that?

Quoted 3 lines

So I was thinking the solution will be to check the console as well, and that brings me back to the first question of locating the device file names for console..

/dev/console?

Again, it all depends on what you are looking for. Look at the Debian persistant naming rules for input devices and see if that solves it for you or not.

Good luck,

greg k-h

-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid0709&bid&3057&dat1642
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel