View Full Version : Kernel module small question

April 30th, 2008, 12:46 AM
hello everyone...
I'm working on a kernel module for my laptop buttons, and every thing is working just fine.

my module generates input events using key codes #defined in linux/input.h BTN_0-BTN_7 0x100-0x107 like this:

set_bit(EV_KEY, button_dev->evbit);
set_bit(BTN_0, button_dev->keybit);

//interrupt handler code:
input_report_key(button_dev, BTN_0, 1);

The problem is how do I map these input events to shell commands ?

I mean there must be a daemon or something that I can use to set the mapping :confused: but I can't seem to find something like this ](*,), or do I need to write it myself ?

Thanks for your time...

April 30th, 2008, 09:15 AM
anyone :( ?

I also can't find detailed documentation about the input device subsystem, if you can post some links that would be great.

May 1st, 2008, 09:58 AM
I just used

set_bit(KEY_*, button_dev->keybit);

instead, and now I can see the key codes with xev. :)

here's a link to the module if anyone's interested.