From ceacc226bc3e988db6c6453a5b429a8b0ca38175 Mon Sep 17 00:00:00 2001 From: Lior Halphon Date: Wed, 23 Jun 2021 21:21:53 +0300 Subject: [PATCH] Fixed Switch Pro Controller in USB mode --- JoyKit/ControllerConfiguration.inc | 5 ++--- JoyKit/JOYController.m | 4 ++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/JoyKit/ControllerConfiguration.inc b/JoyKit/ControllerConfiguration.inc index 6847a82c..40175505 100644 --- a/JoyKit/ControllerConfiguration.inc +++ b/JoyKit/ControllerConfiguration.inc @@ -442,10 +442,9 @@ hacksByName = @{ @{@"reportID": @(1), @"size":@12, @"offset":@76, @"usagePage":@(kHIDPage_GenericDesktop), @"usage":@(kHIDUsage_GD_Ry), @"min": @0xFFF, @"max": @0}, ], }, + + JOYIgnoredReports: @[@(0x30)], // Ignore the real 0x30 report as it's broken }, - - JOYIgnoredReports: @(0x30), // Ignore the real 0x30 report as it's broken - @"PLAYSTATION(R)3 Controller": @{ // DualShock 3 JOYAxisGroups: @{ @(kHIDUsage_GD_X): @(0), diff --git a/JoyKit/JOYController.m b/JoyKit/JOYController.m index 9ec378b5..a8c2b1f6 100644 --- a/JoyKit/JOYController.m +++ b/JoyKit/JOYController.m @@ -451,8 +451,8 @@ typedef union { id previous = nil; NSSet *ignoredReports = nil; - if (hacks[ignoredReports]) { - ignoredReports = [NSSet setWithArray:hacks[ignoredReports]]; + if (hacks[JOYIgnoredReports]) { + ignoredReports = [NSSet setWithArray:hacks[JOYIgnoredReports]]; } for (id _element in array) {