Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
JibbSmart committed Oct 6, 2020
2 parents 51eb253 + 88fdeea commit 9784995
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions JoyShockLibrary/InputHelpers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 2 additions & 0 deletions JoyShockLibrary/JoyShock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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?
Expand Down
1 change: 1 addition & 0 deletions JoyShockLibrary/JoyShockLibrary.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 9784995

Please sign in to comment.