Skip to content

Commit 9784995

Browse files
committed
Merge remote-tracking branch 'origin/master'
2 parents 51eb253 + 88fdeea commit 9784995

File tree

3 files changed

+5
-0
lines changed

3 files changed

+5
-0
lines changed

JoyShockLibrary/InputHelpers.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ bool handle_input(JoyShock *jc, uint8_t *packet, int len, bool &hasIMU) {
3030
}
3131
else {
3232
isValid = packet[0] == 0x01;
33+
if (isValid && (packet[31] & 0x04) == 0x04)
34+
return false; // ignore packets from Dongle with no connected controller
3335
}
3436
if (isValid) {
3537
// Gyroscope:

JoyShockLibrary/JoyShock.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
#define DS4_VENDOR 0x054C
2323
#define DS4_USB 0x05C4
2424
#define DS4_USB_V2 0x09CC
25+
#define DS4_USB_DONGLE 0x0BA0
2526
#define DS4_BT 0x081F
2627

2728
// Joycon and Pro conroller stuff is mostly from
@@ -305,6 +306,7 @@ class JoyShock {
305306

306307
if (dev->product_id == DS4_BT ||
307308
dev->product_id == DS4_USB ||
309+
dev->product_id == DS4_USB_DONGLE ||
308310
dev->product_id == DS4_USB_V2) {
309311
this->name = std::string("DualShock 4");
310312
this->left_right = 3; // left and right?

JoyShockLibrary/JoyShockLibrary.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,7 @@ int JslConnectDevices()
227227
printf("DS4\n");
228228
if (cur_dev->product_id == DS4_USB ||
229229
cur_dev->product_id == DS4_USB_V2 ||
230+
cur_dev->product_id == DS4_USB_DONGLE ||
230231
cur_dev->product_id == DS4_BT) {
231232
JoyShock* jc = new JoyShock(cur_dev, GetUniqueHandle());
232233
_joyshocks.emplace(jc->intHandle, jc);

0 commit comments

Comments
 (0)