Skip to content

Commit 8db8c77

Browse files
nfp0Jiri Kosina
authored andcommitted
HID: nintendo: Fix N64 controller being identified as mouse
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 <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
1 parent 139b4c3 commit 8db8c77

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

drivers/hid/hid-nintendo.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -481,10 +481,10 @@ static const struct joycon_ctlr_button_mapping n64con_button_mappings[] = {
481481
{ BTN_TR, JC_BTN_R, },
482482
{ BTN_TR2, JC_BTN_LSTICK, }, /* ZR */
483483
{ BTN_START, JC_BTN_PLUS, },
484-
{ BTN_FORWARD, JC_BTN_Y, }, /* C UP */
485-
{ BTN_BACK, JC_BTN_ZR, }, /* C DOWN */
486-
{ BTN_LEFT, JC_BTN_X, }, /* C LEFT */
487-
{ BTN_RIGHT, JC_BTN_MINUS, }, /* C RIGHT */
484+
{ BTN_SELECT, JC_BTN_Y, }, /* C UP */
485+
{ BTN_X, JC_BTN_ZR, }, /* C DOWN */
486+
{ BTN_Y, JC_BTN_X, }, /* C LEFT */
487+
{ BTN_C, JC_BTN_MINUS, }, /* C RIGHT */
488488
{ BTN_MODE, JC_BTN_HOME, },
489489
{ BTN_Z, JC_BTN_CAP, },
490490
{ /* sentinel */ },

0 commit comments

Comments
 (0)