so writing a simple driver for input devices is not that tough

today i got the rapoo 8000 2.4 GHz keyboard & mouse(from flipkart), I have tried installing a number of drivers and stuff, unfortunately i couldn’t find the right driver(for a long time) so i tried to write a drive for that.

I have a very little knowledge about the devices in linux. the only thing that i know is that any device will be listed in /dev and after a little googling i found that the input devices are listed under /dev/input/ so after that it was just piece of cake about finding the properties of cat /dev/input/eventX output which is

struct input_event {
struct timeval time;
unsigned short type;
unsigned short code;
unsigned int value;
};

But eventually i realized that the problem is with the dead batteries in the keyboard but not the driver and after that it worked fine, but i wrote this simple program to output the input.

actually i have observed that unlike output devices which cease to perform well if we have opened them from other source, i.e cat /dev/pts/8 the input devices work very well even if opened from another source, THEN it struck-ed me this is how people design key loggers(users won’t be able to recognize if the input device streams are opened from elsewhere). so that program is pretty much a keylogger if i changed the print key ahead statement to printing the memorized key and the other block for memorizing the key.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s