linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: ostapyshyn@sra.uni-hannover.de
To: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Cc: Nils Fuhler <nils@nilsfuhler.de>,
	davidrevoy@protonmail.com, folays@gmail.com,
	jason.gerecke@wacom.com, jkosina@suse.cz,
	jose.exposito89@gmail.com, linux-input@vger.kernel.org,
	linux-kernel@vger.kernel.org, ostapyshyn@sra.uni-hannover.de
Subject: Re: Requesting your attention and expertise regarding a Tablet/Kernel issue
Date: Wed, 08 Nov 2023 23:31:36 +0100	[thread overview]
Message-ID: <87zfzndghj.fsf@sra.uni-hannover.de> (raw)
In-Reply-To: <CAO-hwJ+b4q+8g=Cg5MRJQT2EsxkFZrK_XgJqmHWm=GBHskhDqQ@mail.gmail.com> (Benjamin Tissoires's message of "Wed, 8 Nov 2023 21:34:07 +0100")

On 11/8/23 21:34, Benjamin Tissoires wrote:

> Again, you convinced me that this commit was wrong. If people needs to
> also use an ioctl to "fix" it, then there is something wrong.

I don't think we're on the same page here.  Nobody needs to use an ioctl
to fix 276e14e6c3.  Rather, the _exact opposite_: the bug reporter used
an ioctl to remap Eraser to BTN_STYLUS2.  It stopped working after
276e14e6c3 and broke his workflow.  He reported it as a regression,
starting this whole thread.

> Sorry but I tend to disagree. Relying on the ioctl EVIOCSKEYCODE for
> tuning the behavior of a state machine is just plain wrong. When
> people do that, they are doing it at the wrong level and introducing
> further bugs.
>
> The whole pen and touch HID protocols rely on a state machine. You
> just can not change the meaning of it because your hardware maker
> produced a faulty hardware.
>
> [...]
>
> In the same way, if you remap Tip Switch to KEY-A, you won't get
> clicks from your pen. Assuming you can do that with any event on any
> HID device is just plain wrong.
> That ioctl is OK-ish for "remapping" simple things like keys. In our
> case, the whole firmware follows a state machine, so we can not change
> it. It has to be remapped in a later layer, in libinput, your
> compositor, or in your end user application.

I don't disagree.  Forbidding EVIOCSKEYCODE ioctls for pen and touch HID
is a legitimate way to resolve this (an appealing one too -- accounting
for it in hidinput_hid_event might be a hellish task).

Should we forbid remapping Eraser too?  If your answer is yes, then we
can finish this conversation here and leave the code as it is now,
because __the regression__ is a user not being able to use an ioctl to
remap Eraser after 276e14e6c3.  Otherwise, if we do make an exemption for
David's Eraser, the fix is as simple as replacing BTN_TOUCH with
usage->code on line 1594 of hid-input.c.

> How many of such devices do we have? Are they all UGTablet like the
> XP-PEN? Are they behaving properly on Windows without a proprietary
> driver?
>
> [...]
>
> I might buy the "invertless" devices are a thing if I can get more
> data about it. So far there are only 2 of them, and they add extra
> complexity in the code when we can just patch the devices to do the
> right thing.

There might or might not be more devices like this in the wild.  It looks
like BarrelSwitch2 was added only 2013 [1], which is why so many styli
use Eraser for the second button.  Setting two bits for a single button
just to adhere to Microsoft's *recommendation* is nice for compatibility,
but I can imagine vendors taking a shortcut and omitting Invert
altogether.  The HID specification alone just lists the usages and says
nothing about how they relate to each other.

XP-Pen Artist 24 does work on Windows with the generic driver.  The
Eraser engages as soon as the button is pressed, without touching the
screen.

> New hardware isn't supposed to be supported on an old kernel and is
> not considered as a regression. However, David mentioned that the
> device was "working" on 6.5.0 but broke in 6.5.8 with the patch
> mentioned above. This is a regression that needs to be tackled.
> Especially because it was introduced in 6.6 but backported into 6.5.

To make sure we're talking about the same thing:

1. "Broke" in this context means that the ioctl remapping from Eraser to
   right-click stopped working.

2. XPPen 16 Pro Gen2 is a whole different topic, untouched by 276e14e6c3.

[1] https://www.usb.org/sites/default/files/hutrr46e.txt

  reply	other threads:[~2023-11-08 22:32 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <kRKTNDYigUSblpNgSuZ2H4dX03Of1yD4j_L9GgbyKXcDqZ67yh5HOQfcd7_83U3jZuQzxpKT3L6FXcRkkZIGdl_-PQF14oIB0QmRSfvpc2k=@protonmail.com>
2023-11-01 19:37 ` Requesting your attention and expertise regarding a Tablet/Kernel issue Jiri Kosina
2023-11-02  0:44   ` Bagas Sanjaya
2023-11-02  6:31     ` Linux regression tracking (Thorsten Leemhuis)
2023-11-02  7:51       ` Bagas Sanjaya
2023-11-02  7:44   ` Linux regression tracking #adding (Thorsten Leemhuis)
2023-12-01  8:24     ` Linux regression tracking #update (Thorsten Leemhuis)
2023-11-03 20:05   ` Illia Ostapyshyn
2023-11-04  0:46     ` Bagas Sanjaya
2023-11-06 13:17     ` David Revoy
2023-11-06 16:59       ` Benjamin Tissoires
2023-11-06 20:06         ` Illia Ostapyshyn
2023-11-07  7:59           ` Benjamin Tissoires
2023-11-07 13:40             ` Illia Ostapyshyn
2023-11-08  5:23             ` Eric GOUYER
2023-11-08  9:04               ` Benjamin Tissoires
2023-11-08  9:23                 ` José Expósito
2023-11-08  9:34                   ` Benjamin Tissoires
2023-11-08 18:21                     ` Benjamin Tissoires
2023-11-09  0:32                       ` David Revoy
2023-11-09 11:56                         ` Benjamin Tissoires
2023-11-09 16:13                           ` Benjamin Tissoires
2023-11-09 22:04                             ` David Revoy
2023-11-10 10:19                               ` Benjamin Tissoires
2023-11-11  8:52                               ` Benjamin Tissoires
2023-11-13 22:08                                 ` David Revoy
2023-11-14 14:35                                   ` Benjamin Tissoires
2023-11-15 15:14                                     ` Benjamin Tissoires
2023-11-23 22:12                                       ` David Revoy
2023-11-24 17:18                                         ` Benjamin Tissoires
2023-11-29 15:32                                           ` Benjamin Tissoires
2023-11-30 22:25                                             ` David Revoy
2023-12-01 15:41                                               ` Benjamin Tissoires
2023-11-08 19:40                 ` Nils Fuhler
2023-11-08 20:34                   ` Benjamin Tissoires
2023-11-08 22:31                     ` ostapyshyn [this message]
2023-11-09 11:46                       ` Benjamin Tissoires
2023-11-08 23:18             ` David Revoy
2023-11-09 11:47               ` Benjamin Tissoires
2023-11-11 17:15               ` Thorsten Leemhuis
2023-11-08 22:28         ` David Revoy

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=87zfzndghj.fsf@sra.uni-hannover.de \
    --to=ostapyshyn@sra.uni-hannover.de \
    --cc=benjamin.tissoires@redhat.com \
    --cc=davidrevoy@protonmail.com \
    --cc=folays@gmail.com \
    --cc=jason.gerecke@wacom.com \
    --cc=jkosina@suse.cz \
    --cc=jose.exposito89@gmail.com \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nils@nilsfuhler.de \
    /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).