Index: src/hid/platform/Linux/OFGameController.m ================================================================== --- src/hid/platform/Linux/OFGameController.m +++ src/hid/platform/Linux/OFGameController.m @@ -38,14 +38,20 @@ #import "OFOpenItemFailedException.h" #import "OFOutOfRangeException.h" #import "OFReadFailedException.h" static const uint16_t vendorIDNintendo = 0x057E; +static const uint16_t vendorIDSony = 0x054C; + +/* Nintendo controllers */ static const uint16_t productIDLeftJoycon = 0x2006; static const uint16_t productIDRightJoycon = 0x2007; static const uint16_t productIDN64Controller = 0x2019; +/* Sony controllers */ +static const uint16_t productIDDualSense = 0x0CE6; + @interface OFGameController () - (instancetype)of_initWithPath: (OFString *)path OF_METHOD_FAMILY(init); @end static const uint16_t buttons[] = { @@ -98,10 +104,18 @@ return OFGameControllerCPadLeftButton; case BTN_C: return OFGameControllerCPadRightButton; case BTN_Z: return OFGameControllerCaptureButton; + } + } else if (vendorID == vendorIDSony && + productID == productIDDualSense) { + switch (button) { + case BTN_X: + return OFGameControllerNorthButton; + case BTN_Y: + return OFGameControllerWestButton; } } switch (button) { case BTN_Y: