views:

485

answers:

2

I was trying to capture keyboard events. e.g. I want to drill down a keylogger from the scratch. After 2 hours of fighting I found the following

neel@pc1$ ls -l /dev/input/by-id
lrwxrwxrwx 1 root root 9 2010-05-05 21:33 usb-Plus_More_Enterprise_LTD._USB-compliant_keyboard-event-kbd -> ../event1
lrwxrwxrwx 1 root root 9 2010-05-05 21:33 usb-Plus_More_Enterprise_LTD._USB-compliant_keyboard-event-mouse -> ../event2
lrwxrwxrwx 1 root root 9 2010-05-05 21:33 usb-Plus_More_Enterprise_LTD._USB-compliant_keyboard-mouse -> ../mouse1

But when I tried to

neel@pc1$ sudo cat /dev/input/usb-Plus_More_Enterprise_LTD._USB-compliant_keyboard-event-kbd

It yields nothing THERE WAS NO OUTPUT

after a bit more searching Now I am thinking probabbly something in Xorg blocks it.

So Any more Information ?? and atthe end of the say how can I read the input from that file ?? or is there any other way of capturing keyboard events ??

+1  A: 

You are reading the wrong device. Either try all /dev/input/event* or look in /var/log/Xorg.0.log for which device is used for your keyboard.

Florian Diesch
keyboard is /dev/input/event4 on my fedora box
zdav
keyboard is /dev/input/event3, also symlinked as /dev/input/by-path/platform-i8042-serio-0-event-kbd on ubuntu(9.10)
phoenix24
Ya tested on all all 6 event files.only event5 was responding and writing some shits on beeps.Latter I found Its speakerHowever probabbly you haven't noticed. I am using USB Keyboard !!!!!-- EDIT --`(**) Plus More Enterprise LTD. USB-compliant keyboard: Device: "/dev/input/event2"`But no output in `sudo cat /dev/input/event2`
A: 
msvilans