From: Dmitry Torokhov <dtor_core@ameritech.net>
To: Genadz Batsyan <gbatyan@gmx.net>, linux-kernel@vger.kernel.org
Subject: Re: overriding keyboard driver in a module
Date: Wed, 6 Jul 2005 22:25:06 -0700 (PDT) [thread overview]
Message-ID: <20050707052506.2345.qmail@web81302.mail.yahoo.com> (raw)
In-Reply-To: <200507070341.41095.gbatyan@gmx.net>
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
prev parent reply other threads:[~2005-07-07 5:25 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-07-07 1:41 Genadz Batsyan
2005-07-07 5:25 ` Dmitry Torokhov [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20050707052506.2345.qmail@web81302.mail.yahoo.com \
--to=dtor_core@ameritech.net \
--cc=gbatyan@gmx.net \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®