lkml.org 
[lkml]   [2005]   [Jul]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: overriding keyboard driver in a module
Genadz Batsyan <gbatyan@gmx.net> 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 majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-07-07 07:31    [W:3.139 / U:0.004 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site