linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Samuel Čavoj" <sammko@sammserver.com>
To: Jiri Kosina <jikos@kernel.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
	Benjamin Tissoires <benjamin.tissoires@redhat.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [GIT PULL] HID for 5.7
Date: Fri, 3 Apr 2020 14:22:15 +0200	[thread overview]
Message-ID: <20200403122215.zsi4etbclm6hljrl@fastboi.localdomain> (raw)
In-Reply-To: <nycvar.YFH.7.76.2004031158280.19713@cbobk.fhfr.pm>

On 03.04.2020 12:05, Jiri Kosina wrote:
> On Wed, 1 Apr 2020, Linus Torvalds wrote:
> 
> > Anyway, because I noticed this due to the name, it does strike me that 
> > clearly Windows must be ignoring - or otherwise reacting differently to 
> > - the HID_MAIN_ITEM_CONSTANT flag. Because presumably those mice work 
> > under Windows without special drivers?
> > 
> > In fact, reading that driver, it looks like they report being *both* 
> > constant *and* variable in their report descriptors. Which sounds odd. 
> > Maybe we should do whatever Windows does, and not need a special driver 
> > for this maybe-bot-so-glorious-after-all mouse hardware?
> 
> Adding Samuel to CC.
> 
> From what I understood is that in order to access the buttons reported in 
> report #2 (the one marked with HID_MAIN_ITEM_CONSTANT), you actually *do* 
> need a special software on windows anyway.

The Glorious software is merely used to map the actions to the buttons.
The mouse comes with a common default configuration (forward and back on
the side buttons) but every button can be remapped to any action. I am
used to having a Play/Pause button on my mouse and that's where I
encountered the problem in the first place.

The configuration of the mouse is then stored in the firmware. The
Glorious software is not required to be running or even to be installed
for the mouse to function. The vanilla Windows HID driver is in use.
Sorry if that wasn't clear.

> What we do is that we ignore any changes in reports with 
> HID_MAIN_ITEM_CONSTANT in the HID core.
> 
> It would still be possible to access the report via hidraw, and maybe 
> that's analogy of what the Windows driver/special Glorious software :) 
> does, I don't know. It's hard to believe that Windows would be actually 
> willing to report any changes coming through HID_MAIN_ITEM_CONSTANT 
> reports, but who knows.

It unfortunately appears to be the case. Just for reference, here is the
relevant part of the original descriptor again:
  
  INPUT(2)[INPUT]
    Field(0)
      Flags( Constant Variable Absolute )
    Field(1)
      Flags( Constant Variable Absolute )
    Field(2)
      Flags( Constant Variable Absolute )

Windows accepts the reports just fine. Unless there is something else at
play here, but I don't see anything that could be since the default HID
driver is used on Windows.

I also set the Relative flag instead of Absolute in the driver, in order
to drop repeat events when holding down the button. These are not
desirable in the case of consumer control events, such as 'Next Track'.
This is not a big problem, though.

Regards,
Samuel

  parent reply	other threads:[~2020-04-03 12:22 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-01 12:11 [GIT PULL] HID for 5.7 Jiri Kosina
2020-04-01 22:35 ` pr-tracker-bot
2020-04-01 22:57 ` Linus Torvalds
2020-04-03 10:05   ` Jiri Kosina
2020-04-03 11:35     ` Benjamin Tissoires
2020-04-03 12:22     ` Samuel Čavoj [this message]
2020-05-09 23:12     ` Samuel Čavoj

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=20200403122215.zsi4etbclm6hljrl@fastboi.localdomain \
    --to=sammko@sammserver.com \
    --cc=benjamin.tissoires@redhat.com \
    --cc=jikos@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@linux-foundation.org \
    /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).