Re: [PATCH v2] HID: uclogic: Add support for XP-PEN Artist 22R Pro

From: redstrate
Date: Thu Jan 05 2023 - 17:10:08 EST


> I see this event codes in a test device mock in libinput, but I wonder
> if we could/should use BTN_9 instead of skiping a few IDs here.
>
> Honestly, I don't now what should be the right approach in this case,
> let's see if someone else comments on this topic.

I forgot about BTN_9, that should be an easy change. I already merged changes
upstream in systemd/udev to mark devices with these buttons correctly - so,
sunken cost and all that :-)

> I think that you could use uclogic_params_parse_ugee_v2_desc() and
> change the number of buttons in the template afterwards. It'd avoid
> some code duplication.

Yeah I think that's what I'll do, I was thinking of reusing it and just
overriding parameters if needed.

> There are some XP-Pen PRO devices handled by the other init function.
> Maybe we could rename this function to something more specific to your
> device.

Ah okay, it's pretty specific to this device anyway - so I'll rename the
function so it's clear what it's purpose is. I wasn't sure if future XP-PEN
Pro work was going to reuse this function, but I guess we'll rename it if that
happens!

> You can use "uclogic_ugee_v2_probe_endpoint" here.

Good catch! Will change.

> User-space lacks support for dials, but, with this descriptor, would it
> be possible to differenciate between the 2 dials to, for example,
> assign them different actions? Or would them be exposed as the same
> dial?
>
> I have no idea how would user-space see this, but it'd interesting to
> see how libinput handles it.

Currently userspace sees this as REL_WHEEL and REL_HWHEEL, but like
mentioned libinput currently rejects mouse wheel events from tablet pads.
The fact that they previously worked before these patches is because udev
misclassified the pad device as a mouse. I'm working upstream to expose dials
on tablet pads in libinput (I just got the green light so I'll be working on
that shortly!)

> You can cherry-pick my patch refactoring this variables and send it as
> part of your series. I think that it might help maintainers with the
> merge and it'd also fix the problem reported by the test robot.

Ooh good point, I didn't even consider doing that. Next version will have it
split up into two then.