From: Peter Hutterer <peter.hutterer@who-t.net>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: "Tomasz Pakuła" <tomasz.pakula.oficjalny@gmail.com>,
bentiss@kernel.org, linux-input@vger.kernel.org,
cpuwolf@gmail.com, oleg@makarenk.ooo
Subject: Re: [PATCH] [v2] Input: increase max button number to 0x340
Date: Wed, 7 Aug 2024 15:17:08 +1000 [thread overview]
Message-ID: <20240807051708.GA3551201@quokka> (raw)
In-Reply-To: <ZrL0KD9yDnfHMbL-@google.com>
On Tue, Aug 06, 2024 at 09:12:24PM -0700, Dmitry Torokhov wrote:
> > > > > 2. Can we consider using something other than EV_KEY? For example we
> > > > > could define EV_MSC/MSC_PROG_KEY and EV_MSC/MSG_PROG_VAL pair to allow
> > > > > transmitting key number and state of keys that do not have pre-defined
> > > > > meaning. Here we are losing event deduplication and ability to query
> > > > > full keyboard state, but I wonder how important that is for the devices
> > > > > in question.
> > > >
> > > > The same problem rears its head in the EV_ABS and EV_REL range, so
> > > > fixing it for EV_KEY doesn't necessarily fix it for those.
> > > >
> > > > MSC_PROG_KEY/VAL pairs would make it difficult to send two button
> > > > updates in the same frame without an SYN_MT_REPORT equivalent.
>
> I do not think that frame notion is that important for keys. It is
> typically important for a pointing device state.
true, I remember a conversation years back that frames aren't
consistently implemented in keyboard drivers anyway which is the reason
libinput sends (most) EV_KEY events immediately instad of waiting for a
SYN_REPORT.
> > > All in all, we've had people using this patch (but increasing KEY_MAX to a
> > > whopping 0x4ff) for the past few years with no adverse effects. I've been
> > > using a custom Linux kernel with this patch on my Arch machine since about
> > > May, and didn't notice anything, even when compiling with debug flags and
> > > following and filtering dmesg.
> > >
> > > So here's the thing I'm most curious about. Is this something, you'd just
> > > want to resolve differently, to make it nicer and more logical, or is this
> > > really something that would break everything and doing it in this way will
> > > never be allowed/merged? That would make a lot of us sad :(
>
> We need to figure out not only how to handle your class of devices, but
> also allow extending number of keys that do have certain semantic
> meaning. Peter raised a lot of questions that we need to answer.
>
> But I wonder, these devices with large number of buttons that do not
> have predefined meaning - do they have to be a single input device? Can
> we create N input devices if we exceed the "trigger happy" range, all of
> them mapping to "trigger happy"? That would mean that userspace would
> keep track of key assignment on per-device basis.
>
> We already split HID devices on per-apllication (not userspace but HID
> application) basis, and also when there are several USB interfaces.
Honestly, I'd vote against this.
re-combining input devices into a single device in userspace is a pain.
The split per application in HID is mostly fine because they're
usually physically different devices but I recently ran into the issue
with the uclogic drivers where various features are split across
event nodes. Thse devices have the ring on one event node, the buttons
on another, etc. Nothing in (my) userspace is currently set up for this
and it'd require a major rework in many places to be able to handle this
properly. And it requires that rework in every userspace stack, possibly
special-cased on a vendor id. In the end it was easier (re-)writing BPFs
to get the expected event node behaviour than dealing with the split.
A device that arbitrarily splits makes this even more difficult - which
one of the event nodes has buttons 1-20 and which one has 21-40? We'd need
some other magic somewhere (e.g. hiding in uniq) and some digging around
in udev to figure out which ones are part of the same device.
I'd rather not go with a simple-for-now solution that makes everything
in userspace more complicated, forever.
Cheers,
Peter
next prev parent reply other threads:[~2024-08-07 5:17 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CACa7zykn0q9XJAUvrqnNATr4DUv3Kc7XujF3vm6sfRB5pE6YNQ>
2024-08-02 20:09 ` [PATCH] [v2] Input: increase max button number to 0x340 Tomasz Pakuła
2024-08-02 23:58 ` Dmitry Torokhov
2024-08-05 5:34 ` Peter Hutterer
2024-08-06 17:50 ` Tomasz Pakuła
2024-08-07 3:12 ` Peter Hutterer
2024-08-07 4:12 ` Dmitry Torokhov
2024-08-07 5:17 ` Peter Hutterer [this message]
2024-08-07 6:23 ` Tomasz Pakuła
2024-08-07 8:42 ` Wei Shuai
2024-08-07 19:01 ` Dmitry Torokhov
2024-08-07 20:22 ` Tomasz Pakuła
2024-08-07 21:07 ` Dmitry Torokhov
2024-08-08 7:46 ` Tomasz Pakuła
2024-08-08 16:42 ` Tomasz Pakuła
2024-08-16 0:58 ` Peter Hutterer
2024-08-08 23:00 ` Peter Hutterer
2024-08-07 23:33 ` Peter Hutterer
2024-07-30 11:17 Tomasz Pakuła
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=20240807051708.GA3551201@quokka \
--to=peter.hutterer@who-t.net \
--cc=bentiss@kernel.org \
--cc=cpuwolf@gmail.com \
--cc=dmitry.torokhov@gmail.com \
--cc=linux-input@vger.kernel.org \
--cc=oleg@makarenk.ooo \
--cc=tomasz.pakula.oficjalny@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).