Skip to content

Commit

Permalink
Merge pull request #22 from elliotwoods/TouchUpID
Browse files Browse the repository at this point in the history
Thx for your effort! Looking great
  • Loading branch information
Ohjurot committed Apr 12, 2021
2 parents 9563e89 + e405187 commit 0b869f4
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
10 changes: 10 additions & 0 deletions VS19_Solution/DualSenseWindows/include/DualSenseWindows/DS5State.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,16 @@ namespace DS5W {
/// Y position of finger (~ 0 - 2048)
/// </summary>
unsigned int y;

/// <summary>
/// Touch is down
/// </summary>
bool down;

/// <summary>
/// 7-bit ID for touch
/// </summary>
unsigned char id;
} Touch;

typedef struct _Battery {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,15 @@ void __DS5W::Input::evaluateHidInputBuffer(unsigned char* hidInBuffer, DS5W::DS5
UINT32 touchpad1Raw = *(UINT32*)(&hidInBuffer[0x20]);
ptrInputState->touchPoint1.y = (touchpad1Raw & 0xFFF00000) >> 20;
ptrInputState->touchPoint1.x = (touchpad1Raw & 0x000FFF00) >> 8;
ptrInputState->touchPoint1.down = (touchpad1Raw & (1 << 7)) == 0;
ptrInputState->touchPoint1.id = (touchpad1Raw & 127);

// Evaluate touch state 2
UINT32 touchpad2Raw = *(UINT32*)(&hidInBuffer[0x24]);
ptrInputState->touchPoint2.y = (touchpad2Raw & 0xFFF00000) >> 20;
ptrInputState->touchPoint2.x = (touchpad2Raw & 0x000FFF00) >> 8;
ptrInputState->touchPoint2.down = (touchpad2Raw & (1 << 7)) == 0;
ptrInputState->touchPoint2.id = (touchpad2Raw & 127);

// Evaluate headphone input
ptrInputState->headPhoneConnected = hidInBuffer[0x35] & 0x01;
Expand Down

0 comments on commit 0b869f4

Please sign in to comment.