diff --git a/JoyShockLibrary/InputHelpers.cpp b/JoyShockLibrary/InputHelpers.cpp index e34988e..866419e 100644 --- a/JoyShockLibrary/InputHelpers.cpp +++ b/JoyShockLibrary/InputHelpers.cpp @@ -30,6 +30,8 @@ bool handle_input(JoyShock *jc, uint8_t *packet, int len, bool &hasIMU) { } else { isValid = packet[0] == 0x01; + if (isValid && (packet[31] & 0x04) == 0x04) + return false; // ignore packets from Dongle with no connected controller } if (isValid) { // Gyroscope: diff --git a/JoyShockLibrary/JoyShock.cpp b/JoyShockLibrary/JoyShock.cpp index bb5564a..2e553a3 100644 --- a/JoyShockLibrary/JoyShock.cpp +++ b/JoyShockLibrary/JoyShock.cpp @@ -22,6 +22,7 @@ #define DS4_VENDOR 0x054C #define DS4_USB 0x05C4 #define DS4_USB_V2 0x09CC +#define DS4_USB_DONGLE 0x0BA0 #define DS4_BT 0x081F // Joycon and Pro conroller stuff is mostly from @@ -305,6 +306,7 @@ class JoyShock { if (dev->product_id == DS4_BT || dev->product_id == DS4_USB || + dev->product_id == DS4_USB_DONGLE || dev->product_id == DS4_USB_V2) { this->name = std::string("DualShock 4"); this->left_right = 3; // left and right? diff --git a/JoyShockLibrary/JoyShockLibrary.cpp b/JoyShockLibrary/JoyShockLibrary.cpp index d91afdd..5eec823 100644 --- a/JoyShockLibrary/JoyShockLibrary.cpp +++ b/JoyShockLibrary/JoyShockLibrary.cpp @@ -227,6 +227,7 @@ int JslConnectDevices() printf("DS4\n"); if (cur_dev->product_id == DS4_USB || cur_dev->product_id == DS4_USB_V2 || + cur_dev->product_id == DS4_USB_DONGLE || cur_dev->product_id == DS4_BT) { JoyShock* jc = new JoyShock(cur_dev, GetUniqueHandle()); _joyshocks.emplace(jc->intHandle, jc);