Re: overriding keyboard driver in a module

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Genadz Batsyan <[email protected]> wrote:
> I'm writing a little tool to allow intercepting keyboard events and 
> substituting them with other events / swallowing events / emitting
> additional 
> events on a low level before normal processing by kernel.
> http://kbd-mangler.sourceforge.net/
> 
> Currently to have precedense over the keyboard driver I'm using a patch 
> against drivers/input/keyboard/atkbd.c
> 
> Well, I guess, patching kernel is unthinkable for most linux users, so I 
> thought, maybe there is a way to do it without the kernel patch.
> Is it possible to write a kernel module to intercept keyboard events
> and have precedense over the kernel driver?
> 

You can try opening corresponding event device (/dev/input/eventX),
grabbing it so nobody except for your process would get any events
from the corresponding keyboard (EVIOCGRAB ioctl), and then read
events, mangle them and inject them back into kernel through uinput
driver.

As an additional plus it should work for any keyboard (or rather any
input device), not only PS/2 keyboard.

-- 
Dmitry
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]
  Powered by Linux