linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Max Sivkov <maxsivkov@gmail.com>
Cc: linux-input@vger.kernel.org
Subject: Re: input subsystem question
Date: Mon, 14 Sep 2009 01:21:48 -0700	[thread overview]
Message-ID: <20090914082148.GD11854@core.coreip.homeip.net> (raw)
In-Reply-To: <loom.20090910T195819-563@post.gmane.org>

On Thu, Sep 10, 2009 at 06:15:18PM +0000, Max Sivkov wrote:
> Dmitry Torokhov <dmitry.torokhov <at> gmail.com> writes:
> 
> > 
> > Hi Max,
> > 
> > On Thursday 10 September 2009 01:20:02 am Max Sivkov wrote:
> > > Hello!
> > > I have a question about using of the input subsystem.
> > > Is there any way to filter input messages from a device (keyboard). I.e. I
> > > need to have ability to pass some messages from the device, and block
> > > others. Could community point me to the right place where I can find how to
> > > do that?
> > 
> > There are different options, we'd need more context...
> > 
> 
> 
> Dmitry,
> 
> Thanks for the response.
> 
> Driver/user mode daemon should get scancodes (events) from the input device
> (keyboard), detect particular scancodes and put them to the internal buffer to
> send to the user space later time.
> 
> I'm stucked here, because after getting event from the input subsystem I will
> need to remove the event from the input queue. 
> As I understood events mechanism is useful if one needs to gather input event's
> (keylogger) w/o modifying input queue.
> 
> Currently my driver for 2.6.x kernels is based on a atkbd driver with some
> modifications, but this method has one big disadvantage: when input subsystem
> developers change something in the input subsystem I have to do the annoying job
> once again (take atkbd.c, add my functionality, rebuild kernel, etc, etc).
> 

If you want to work on keycode level (KEY_* definitions) then you could
use a user-space program that "grabs" input device, filters out the
events it is interested in and injects events that it has no interested
in back into kernel via uinput.

If you want to work with AT keyboard scancodes and intercept them before
they reach atkbd driver - then we currently don't have such an option
although one is desired since some laptop vendors like to inject
non-keyboard data into keyboard stream.

-- 
Dmitry

      reply	other threads:[~2009-09-14  8:21 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-10  8:20 input subsystem question Max Sivkov
2009-09-10 16:22 ` Dmitry Torokhov
2009-09-10 18:15   ` Max Sivkov
2009-09-14  8:21     ` 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=20090914082148.GD11854@core.coreip.homeip.net \
    --to=dmitry.torokhov@gmail.com \
    --cc=linux-input@vger.kernel.org \
    --cc=maxsivkov@gmail.com \
    /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;
as well as URLs for NNTP newsgroup(s).