Index: src/hid/OHEvdevGameController.m ================================================================== --- src/hid/OHEvdevGameController.m +++ src/hid/OHEvdevGameController.m @@ -111,23 +111,63 @@ return @"L3"; case BTN_THUMBR: return @"R3"; case BTN_START: return @"Options"; + case BTN_SELECT: + if (productID == OHProductIDDualSense) + return @"Create"; + else + return @"Share"; case BTN_MODE: return @"PS"; } - } - - if (vendorID == OHVendorIDSony && productID == OHProductIDDualSense) - if (button == BTN_SELECT) - return @"Create"; - if (vendorID == OHVendorIDSony && productID == OHProductIDDualShock4) - if (button == BTN_SELECT) - return @"Share"; - - if (vendorID == OHVendorIDGoogle && + } else if (vendorID == OHVendorIDNintendo && + productID == OHProductIDLeftJoyCon) { + switch (button) { + case BTN_TL: + return @"L"; + case BTN_TL2: + return @"ZL"; + case BTN_THUMBL: + return @"Left Stick"; + case BTN_SELECT: + return @"-"; + case BTN_Z: + return @"Capture"; + case BTN_TR: + return @"SL"; + case BTN_TR2: + return @"SR"; + } + } else if (vendorID == OHVendorIDNintendo && + productID == OHProductIDRightJoyCon) { + switch (button) { + case BTN_NORTH: + return @"X"; + case BTN_SOUTH: + return @"B"; + case BTN_WEST: + return @"Y"; + case BTN_EAST: + return @"A"; + case BTN_TR: + return @"R"; + case BTN_TR2: + return @"ZR"; + case BTN_THUMBR: + return @"Right Stick"; + case BTN_START: + return @"+"; + case BTN_MODE: + return @"Home"; + case BTN_TL: + return @"SL"; + case BTN_TL2: + return @"SR"; + } + } else if (vendorID == OHVendorIDGoogle && productID == OHProductIDStadiaController) { switch (button) { case BTN_TL: return @"L1"; case BTN_TR: Index: src/hid/OHGameController.h ================================================================== --- src/hid/OHGameController.h +++ src/hid/OHGameController.h @@ -98,13 +98,16 @@ #ifdef __cplusplus extern "C" { #endif extern const uint16_t OHVendorIDSony; +extern const uint16_t OHVendorIDNintendo; extern const uint16_t OHVendorIDGoogle; extern const uint16_t OHProductIDDualShock4; extern const uint16_t OHProductIDDualSense; +extern const uint16_t OHProductIDLeftJoyCon; +extern const uint16_t OHProductIDRightJoyCon; extern const uint16_t OHProductIDStadiaController; #ifdef __cplusplus } #endif Index: src/hid/OHGameController.m ================================================================== --- src/hid/OHGameController.m +++ src/hid/OHGameController.m @@ -37,13 +37,16 @@ #ifdef OF_NINTENDO_3DS # import "OHNintendo3DSGameController.h" #endif const uint16_t OHVendorIDSony = 0x054C; +const uint16_t OHVendorIDNintendo = 0x057E; const uint16_t OHVendorIDGoogle = 0x18D1; const uint16_t OHProductIDDualShock4 = 0x09CC; const uint16_t OHProductIDDualSense = 0x0CE6; +const uint16_t OHProductIDLeftJoyCon = 0x2006; +const uint16_t OHProductIDRightJoyCon = 0x2007; const uint16_t OHProductIDStadiaController = 0x9400; @implementation OHGameController @dynamic name, rawProfile;