There is a keyboard notifier in the kernel that you can use:
#include <linux/notifier.h>
static int keyboard_notifier_call(struct notifier_block *blk,
unsigned long code, void *_param)
{
printk(KERN_INFO "code=%ld\n", code);
return NOTIFY_OK;
}
static struct notifier_block keyboard_notifier_block = {
.notifier_call = keyboard_notifier_call,
};
// add that to the init module
register_keyboard_notifier(&keyboard_notifier_block);
// add that to the cleanup module
unregister_keyboard_notifier(&keyboard_notifier_block);
Shahar.
#include <linux/notifier.h>
static int keyboard_notifier_call(struct notifier_block *blk,
unsigned long code, void *_param)
{
printk(KERN_INFO "code=%ld\n", code);
return NOTIFY_OK;
}
static struct notifier_block keyboard_notifier_block = {
.notifier_call = keyboard_notifier_call,
};
// add that to the init module
register_keyboard_notifier(&keyboard_notifier_block);
// add that to the cleanup module
unregister_keyboard_notifier(&keyboard_notifier_block);
Shahar.
On Sat, Dec 5, 2009 at 11:57 PM, Herlin R. Matos Lastres <hmatos@xxxxxxxxxx> wrote:
Hi,
I need manage the keyboard, for example read the data comming from keyboard.
thanks.
--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ