From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Mika Westerberg <mika.westerberg@iki.fi>
Cc: Daniel Mack <daniel@caiaq.de>, linux-input@vger.kernel.org
Subject: Re: Query last reported event state
Date: Wed, 25 Nov 2009 19:51:42 -0800 [thread overview]
Message-ID: <20091126035142.GB23244@core.coreip.homeip.net> (raw)
In-Reply-To: <20091124195729.GB27249@gw.healthdatacare.com>
On Tue, Nov 24, 2009 at 09:57:29PM +0200, Mika Westerberg wrote:
> Hi Daniel,
>
> On Tue, Nov 24, 2009 at 06:33:56PM +0100, Daniel Mack wrote:
> > Hi,
> >
> > is there a way to query the last state an input device reported,
> > preferably even for a special key mask? When a button is pressed and a
> > userspace application is started, it should be able to figure out the
> > current state, especially because those GPIO signals are likely
> > connected to other peripherals to report arbitrary events in the system.
> > Is there any such framework for that purpose?
>
> Not sure whether this helps, but you can look <linux/input.h> and
> check what ioctl()s it provides for this purpose. At least there
> seems to be:
> EVIOCGKEY - get global keystate
> EVIOCGSW - get all switch states
> EVIOCGBIT - get event bits
>
> Maybe you can use some of these to query current status of input events.
This is correct. The first 2 ioctls are there so userspace can get the
current state of input device. The last ioctl is to query capabilities,
not the state though.
--
Dmitry
prev parent reply other threads:[~2009-11-26 3:51 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-11-24 17:33 Query last reported event state Daniel Mack
2009-11-24 19:57 ` Mika Westerberg
2009-11-26 3:51 ` 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=20091126035142.GB23244@core.coreip.homeip.net \
--to=dmitry.torokhov@gmail.com \
--cc=daniel@caiaq.de \
--cc=linux-input@vger.kernel.org \
--cc=mika.westerberg@iki.fi \
/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