From: Bastien Nocera <hadess@hadess.net>
To: Tim Schumacher <tim@tschumacher.net>, linux-input@vger.kernel.org
Cc: "Filipe Laíns" <lains@riseup.net>
Subject: Re: [PATCH] hid-logitech-hidpp: holdable_thumb_buttons parameter for Logitech MX Anywhere 3
Date: Mon, 03 Oct 2022 09:55:54 +0200 [thread overview]
Message-ID: <1fa677b0ead9daec4cedfdfe26194463aea043ae.camel@hadess.net> (raw)
In-Reply-To: <20db9bf2-e901-5021-c4b2-7b1e7759ba9c@tschumacher.net>
On Mon, 2022-10-03 at 00:36 +0200, Tim Schumacher wrote:
> On the Logitech MX Anywhere 3 the thumb buttons only activate on
> release.
> This is because the mouse also uses those buttons as modifiers to
> enable
> horizontal scrolling with the mouse wheel. This patch adds the
> holdable_thumb_buttons module parameter. Users who don't care about
> horizontal scrolling and want properly functioning thumb buttons can
> set
> this parameter. If it's set we use the feature 0x1b04 (special keys
> and
> mouse buttons) to divert thumb button events and handle them in
> software.
>
> Signed-off-by: Tim Schumacher <tim@tschumacher.net>
> ---
>
> Hi,
>
> this is my first kernel patch, please be nice :)
> The reason this can't be done in user space with a tool like xmodmap
> (exception would be a user space driver) is that without making use
> of
> the 0x1b04 feature the mouse sends nothing whatsoever when the thumb
> buttons are pressed down so we can't handle those events. I
> discovered
> this because the thumb buttons felt unresponsive on my mouse and it's
> been bugging me since.
>
> I'm not sure if other Logitech devices could benefit from this patch,
> something in the spirit of "thumb buttons only activate on release"
> has
> been said about the MX Master series mice on the Arch wiki but I'm
> not
> sure if this is true or if the patch would work as-is. Hope this is
> not
> too specific to get into the kernel.
>
> <snip>
> + { /* Mouse Logitech MX Anywhere 3 */
> + LDJ_DEVICE(0x4090), .driver_data =
> HIDPP_QUIRK_CLASS_MX_ANYWHERE_3 },
As discussed in recent hid-logitech-hidpp related discussions, new
settings should be gated by asking the hardware whether it supports a
particular feature, rather than hardcoding device IDs.
See:
https://git.kernel.org/pub/scm/linux/kernel/git/hid/hid.git/commit/?h=for-6.1/logitech&id=908d325e1665b2781085580070554cbbe5fc3c89
As a sidenote, make sure to run your patches through checkpatch.pl, it
should warn you that C++ style comments aren't allowed.
You should also not use magic numbers (0x53/0x56) and define them as
constants instead.
> { /* Keyboard logitech K400 */
> LDJ_DEVICE(0x4024),
> .driver_data = HIDPP_QUIRK_CLASS_K400 },
Looking forward to v2!
prev parent reply other threads:[~2022-10-03 8:22 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-02 22:36 [PATCH] hid-logitech-hidpp: holdable_thumb_buttons parameter for Logitech MX Anywhere 3 Tim Schumacher
2022-10-03 7:55 ` Bastien Nocera [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=1fa677b0ead9daec4cedfdfe26194463aea043ae.camel@hadess.net \
--to=hadess@hadess.net \
--cc=lains@riseup.net \
--cc=linux-input@vger.kernel.org \
--cc=tim@tschumacher.net \
/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).