# \[PATCH\] HID: nintendo: Fix N64 controller being identified as mouse

- Subsystems: HID CORE LAYER, NINTENDO HID DRIVER, THE REST
- Maintainers: Jiri Kosina, Benjamin Tissoires, Daniel J. Ogorchock, Vicki Pfau, Linus Torvalds
- List: linux-input
- 4 messages, 2 authors
- Page: https://ratatoskr.run/linux-input/2024/02/8936498/t

## \[PATCH\] HID: nintendo: Fix N64 controller being identified as mouse

- From: Nuno Pereira \<hidden\>
- Date: 2024-02-26 22:39:33 
- Message: https://ratatoskr.run/linux-input/2024/02/8936498.md

```text
This patch is regarding the recent addition of support for the NSO
controllers to hid-nintendo. All controllers are working correctly with the
exception of the N64 controller, which is being identified as a mouse by
udev. This results in the joystick controlling the mouse cursor and the
controller not being detected by games.

The reason for this is because the N64's C buttons have been attributed to
BTN_FORWARD, BTN_BACK, BTN_LEFT, BTN_RIGHT, which are buttons typically
attributed to mice.

This patch changes those buttons to controller buttons, making the
controller be correctly identified as such.

Signed-off-by: Nuno Pereira <redacted>
---
 drivers/hid/hid-nintendo.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/hid/hid-nintendo.c b/drivers/hid/hid-nintendo.c
index ccc4032fb2b0..4b2c81b49b80 100644
--- a/drivers/hid/hid-nintendo.c
+++ b/drivers/hid/hid-nintendo.c
@@ -481,10 +481,10 @@ static const struct joycon_ctlr_button_mapping n64con_button_mappings[] = {
 	{ BTN_TR,		JC_BTN_R,	},
 	{ BTN_TR2,		JC_BTN_LSTICK,	}, /* ZR */
 	{ BTN_START,		JC_BTN_PLUS,	},
-	{ BTN_FORWARD,		JC_BTN_Y,	}, /* C UP */
-	{ BTN_BACK,		JC_BTN_ZR,	}, /* C DOWN */
-	{ BTN_LEFT,		JC_BTN_X,	}, /* C LEFT */
-	{ BTN_RIGHT,		JC_BTN_MINUS,	}, /* C RIGHT */
+	{ BTN_SELECT,		JC_BTN_Y,	}, /* C UP */
+	{ BTN_X,		JC_BTN_ZR,	}, /* C DOWN */
+	{ BTN_Y,		JC_BTN_X,	}, /* C LEFT */
+	{ BTN_C,		JC_BTN_MINUS,	}, /* C RIGHT */
 	{ BTN_MODE,		JC_BTN_HOME,	},
 	{ BTN_Z,		JC_BTN_CAP,	},
 	{ /* sentinel */ },
-- 
2.43.2
```

## Re: \[PATCH\] HID: nintendo: Fix N64 controller being identified as mouse

- From: Jiri Kosina \<jikos@kernel.org\>
- Date: 2024-03-22 11:02:06 
- Message: https://ratatoskr.run/linux-input/2024/03/8936590.md

```text
On Mon, 26 Feb 2024, Nuno Pereira wrote:

> This patch is regarding the recent addition of support for the NSO
> controllers to hid-nintendo. All controllers are working correctly with the
> exception of the N64 controller, which is being identified as a mouse by
> udev. This results in the joystick controlling the mouse cursor and the
> controller not being detected by games.
> 
> The reason for this is because the N64's C buttons have been attributed to
> BTN_FORWARD, BTN_BACK, BTN_LEFT, BTN_RIGHT, which are buttons typically
> attributed to mice.
> 
> This patch changes those buttons to controller buttons, making the
> controller be correctly identified as such.
> 
> Signed-off-by: Nuno Pereira <redacted>

Thanks for the fix. I believe it's missing

	Fixes: 94f18bb1994591 ("HID: nintendo: add support for nso controllers")

tag.

Ryan, what was the reason for your initial assignment to FWD/BCK/LFT/RGHT 
instad of SELECT/X/Y/C ?

Thanks,

-- 
Jiri Kosina
SUSE Labs

```

## Re: \[PATCH\] HID: nintendo: Fix N64 controller being identified as mouse

- From: Nuno Pereira \<hidden\>
- Date: 2024-03-22 17:06:04 
- Message: https://ratatoskr.run/linux-input/2024/03/8936591.md

```text
Should I resubmit a v2 with that tag? Or is it not necessary?
Sorry for the clumsiness, it's my first patch.

Nuno Pereira


From: Jiri Kosina <jikos@kernel.org>
Sent: Friday, March 22, 2024 11:02
To: Nuno Pereira <redacted>
Cc: <redacted> <redacted>; Daniel Ogorchock <djogorchock@gmail.com>; Ryan McClelland <redacted>; <redacted> <redacted>
Subject: Re: [PATCH] HID: nintendo: Fix N64 controller being identified as mouse
 
On Mon, 26 Feb 2024, Nuno Pereira wrote:

> This patch is regarding the recent addition of support for the NSO
> controllers to hid-nintendo. All controllers are working correctly with the
> exception of the N64 controller, which is being identified as a mouse by
> udev. This results in the joystick controlling the mouse cursor and the
> controller not being detected by games.
>
> The reason for this is because the N64's C buttons have been attributed to
> BTN_FORWARD, BTN_BACK, BTN_LEFT, BTN_RIGHT, which are buttons typically
> attributed to mice.
>
> This patch changes those buttons to controller buttons, making the
> controller be correctly identified as such.
>
> Signed-off-by: Nuno Pereira <redacted>

Thanks for the fix. I believe it's missing

        Fixes: 94f18bb1994591 ("HID: nintendo: add support for nso controllers")

tag.

Ryan, what was the reason for your initial assignment to FWD/BCK/LFT/RGHT
instad of SELECT/X/Y/C ?

Thanks,

--
Jiri Kosina
SUSE Labs

```

## Re: \[PATCH\] HID: nintendo: Fix N64 controller being identified as mouse

- From: Jiri Kosina \<jikos@kernel.org\>
- Date: 2024-04-03 11:19:46 
- Message: https://ratatoskr.run/linux-input/2024/04/8936604.md

```text
On Mon, 26 Feb 2024, Nuno Pereira wrote:

> This patch is regarding the recent addition of support for the NSO
> controllers to hid-nintendo. All controllers are working correctly with the
> exception of the N64 controller, which is being identified as a mouse by
> udev. This results in the joystick controlling the mouse cursor and the
> controller not being detected by games.
> 
> The reason for this is because the N64's C buttons have been attributed to
> BTN_FORWARD, BTN_BACK, BTN_LEFT, BTN_RIGHT, which are buttons typically
> attributed to mice.
> 
> This patch changes those buttons to controller buttons, making the
> controller be correctly identified as such.
> 
> Signed-off-by: Nuno Pereira <redacted>

Applied, thanks.

-- 
Jiri Kosina
SUSE Labs

```
