From: "Zephaniah E. Hull" <warp@aehallh.com>
To: Dmitry Torokhov <dtor@insightbb.com>
Cc: "Magnus Vigerlöf" <wigge@bigfoot.com>,
linux-input@atrey.karlin.mff.cuni.cz,
linux-kernel@vger.kernel.org
Subject: Re: input: evdev.c EVIOCGRAB semantics question
Date: Sat, 12 Aug 2006 23:28:21 -0400 [thread overview]
Message-ID: <20060813032821.GB5251@aehallh.com> (raw)
In-Reply-To: <200608122000.47904.dtor@insightbb.com>
[-- Attachment #1: Type: text/plain, Size: 2624 bytes --]
On Sat, Aug 12, 2006 at 08:00:47PM -0400, Dmitry Torokhov wrote:
> On Saturday 12 August 2006 12:52, Zephaniah E. Hull wrote:
> > I can dust off the masking patch sometime here if Dmitry thinks that
> > he'd be willing to see a second method for this in addition to grabbing,
> > adding support to xf86-input-evdev would be trivial, and the same could
> > probably be said for the wacom driver that does grabbing at the moment.
> >
>
> I would not mind if we get it working right ;) Do we need to turn off
> "undesirable" handlers or do we want to limit output to one particular
> handler? I'd prefer the former, if possible. Do we keep a counter or
> set of counters so several processes can mask output, etc. Can we keep
> event delivery somewhat fast?
EVIOCGRAB provides for the latter, though it seems to go too far and
mess with sysrq as well.
My old old EVIOCMASK patch just added a long (or was it an int? It's
been a while) to each device struct, and to each handler struct, and if
they had bits set in common then they received the events, and if not
they did not.
That was the cost of a quick & operation and a branch in the input event
path, so not too expensive, though my memory seems to indicate that I
tried to play some evil games to invert the bits first to allow things
to be zero inited.
I'd definitely want to just rewrite it these days, but that approach is
fast, and if we define it something along the lines of 'bit 0 is the
kernel console layer, bit 1 is any further handlers in the kernel like
/dev/input/mice or the joystick interface, the rest belong to userspace'
that gives userspace plenty of bits for odd policy decisions.
One obvious catch is that programs would have to be careful to reset the
mask when leaving, though having the sysrq handler always present and
adding controls for 'reset input device masks' would be one escape
route for X masking keyboard events from the kernel, then crashing
messily.
We probably don't want to automaticly reset on close by a program that
did the masking, as I can see some cases where someone might want to use
a utility that adjusts the masks on input devices.
On a side note, if we mess with sysrq for the masking, we should add a
'ungrab all input devices' one as well.
Zephaniah E. Hull.
--
1024D/E65A7801 Zephaniah E. Hull <warp@aehallh.com>
92ED 94E4 B1E6 3624 226D 5727 4453 008B E65A 7801
CCs of replies from mailing lists are requested.
<aj> ``Who killed the server at the colo site?'' ``Weasel killed the
server at the colo site'' ``Not me'' ``Then who?'' ``m2 killed the
server at the colo site'' ...
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
next prev parent reply other threads:[~2006-08-13 3:28 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-08-12 15:24 Magnus Vigerlöf
2006-08-12 16:52 ` Zephaniah E. Hull
2006-08-12 21:06 ` Magnus Vigerlöf
2006-08-13 0:00 ` Dmitry Torokhov
2006-08-13 3:28 ` Zephaniah E. Hull [this message]
2006-08-14 14:20 ` Dmitry Torokhov
2006-08-14 14:28 ` Zephaniah E. Hull
2006-08-14 15:00 ` Dmitry Torokhov
2006-08-14 16:04 ` Ian Stirling
2006-08-14 16:09 ` Zephaniah E. Hull
2006-08-14 16:22 ` Dmitry Torokhov
2006-08-14 14:58 ` Mattia Dongili
2006-08-14 15:15 ` Dmitry Torokhov
2006-08-14 22:49 ` Magnus Vigerlöf
2006-08-15 11:51 ` Magnus Vigerlöf
2006-08-15 23:20 ` Magnus Vigerlöf
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=20060813032821.GB5251@aehallh.com \
--to=warp@aehallh.com \
--cc=dtor@insightbb.com \
--cc=linux-input@atrey.karlin.mff.cuni.cz \
--cc=linux-kernel@vger.kernel.org \
--cc=wigge@bigfoot.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
all inboxes | Powered by JetHome®