linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Daniel Morse <dmorse@speedfox.co.uk>
To: David Rheinsberg <david.rheinsberg@gmail.com>
Cc: Jiri Kosina <jikos@kernel.org>,
	"open list:HID CORE LAYER" <linux-input@vger.kernel.org>
Subject: Re: [PATCH v3] HID: Wiimote: Treat the d-pad as an analogue stick
Date: Mon, 1 Jun 2020 10:46:16 +0100	[thread overview]
Message-ID: <CANFaMLFFqGi__011BFEL485X91LOw6rxTGynRyNDPD5JVr5c_g@mail.gmail.com> (raw)
In-Reply-To: <CADyDSO5=fN=yw0kZQDpEgrbYXO-PCHDVcYbTk9n1X5XKFef+cA@mail.gmail.com>

On Mon, 1 Jun 2020 at 08:27, David Rheinsberg
<david.rheinsberg@gmail.com> wrote:
>
> Hi
>
> On Sat, 30 May 2020 at 17:04, Daniel Morse <dmorse@speedfox.co.uk> wrote:
> >
> > The controllers from the Super Nintendo Classic Edition (AKA the SNES
> > Mini) appear as a Classic Controller Pro when connected to a Wii
> > Remote. All the buttons work as the same, with the d-pad being mapped
> > the same as the d-pad on the Classic Controller Pro. This differs from
> > the behaviour of most controllers with d-pads and no analogue sticks,
> > where the d-pad maps to ABS_HAT1X for left and right, and ABS_HAT1Y
> > for up and down. This patch adds an option to the hid-wiimote module
> > to make the Super Nintendo Classic Controller behave this way.
> >
> > The patch has been tested with a Super Nintendo Classic Controller
> > plugged into a Wii Remote in both with the option both enabled and
> > disabled. When enabled the d-pad acts as the analogue control, and
> > when disabled it acts as it did before the patch was applied. This
> > patch has not been tested with e Wii Classic Controller (either the
> > original or the pro version) as I do not have one of these
> > controllers.
> >
> > Although I have not tested it with these controllers, I think it is
> > likely this patch will also work with the NES Classic Edition
> > Controllers.
> >
> > Changes from V1 to V2
> > * 3 if statements to control the behaviour, one to make the d-pad
> > register as button presses when the behaviour is disabled, and 2 to
> > make it act as an analog stick when enabled (once for each of the
> > motion plus states)
> > * the values for lx and ly are calculated and then passed to
> > input_report_abs() in one place, rather then calling
> > input_report_abs() from different places depending on how the values
> > are determined.
> > * using an array to map from button presses to analog value.
> > * reduced the values used to indicate the position of the analog stick
> >
> > Changes from V3 to V3
> > * Moved the definition of dpad_as_analog in hid-wiimote.h
> > * Renamed the dpad_as_analog vaiable to wiimote_dpad_as_analog
> > * changed digital_to_analog from an __s8 to static const s8
> > * Removed the unnecessary braces when getting values from digital_to_analog
> >
> > Note: I have also attached a patch file to this final version in
> > addition to the code in the body because gmail web client keeps
> > turning the tabs into spaces.
> >
> > Signed-off-by: Daniel G. Morse <dmorse@speedfox.co.uk>
> > Reviewed-by: David Rheinsberg <david.rheinsberg@gmail.com>
> >
> > From 8909feec10fda919d1ec46c95418d63ac52ee41f Mon Sep 17 00:00:00 2001
> > From: Speedfox <speedfox@speedfox.co.uk>
> > Date: Tue, 26 May 2020 02:55:50 +0100
> > Subject: [PATCH] Added option to make d-pad analog
> >
> > Updates from code review
> > ---
>
> You can put comments below these 3 dashes^^. There seems to be some
> email-header in the commit message above, and the changes between
> versions can also be put outside of the commit message. Some
> subsystems keep it in the commit-message, though. Maybe Jiri can strip
> that when applying? The `Signed-off-by`-etc lines are usually last in
> the commit-message. I don't mind either way.

Since it's probably best that Jiri applies the patch from the
attachment which I included to get around gmail's inability to use
tabs, I think it'll be easiest to let him strip out that superfluous
email header when he does that rather than me sending another version
of the patch.

>
> Anyway, thanks for the patch, looks all good!
> David


Thanks again for reviewing my patch.

--Daniel

  reply	other threads:[~2020-06-01  9:46 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-30 15:04 [PATCH v3] HID: Wiimote: Treat the d-pad as an analogue stick Daniel Morse
2020-06-01  7:27 ` David Rheinsberg
2020-06-01  9:46   ` Daniel Morse [this message]
2020-06-09  9:16     ` Daniel Morse
2020-06-09 13:09       ` David Rheinsberg
2020-06-19  7:25 ` Jiri Kosina
2020-06-19 11:35   ` David Herrmann
2020-06-19 11:41     ` Jiri Kosina
2020-06-19 11:44       ` Daniel Morse
2020-06-19 12:18         ` Jiri Kosina
2020-06-19 12:53           ` Daniel Morse

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=CANFaMLFFqGi__011BFEL485X91LOw6rxTGynRyNDPD5JVr5c_g@mail.gmail.com \
    --to=dmorse@speedfox.co.uk \
    --cc=david.rheinsberg@gmail.com \
    --cc=jikos@kernel.org \
    --cc=linux-input@vger.kernel.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).