Skip to content

Commit

Permalink
more work on tap/click support
Browse files Browse the repository at this point in the history
  • Loading branch information
Valkirie committed Nov 23, 2021
1 parent fc28d32 commit 24f1a78
Showing 1 changed file with 20 additions and 15 deletions.
35 changes: 20 additions & 15 deletions ControllerService/DS4Touch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,20 @@ public DS4Touch()

public void OnMouseUp(short X, short Y, int Button)
{
OutputClickButton = false;
if (X != -1) TouchX = (short)(X * RatioWidth);
if (Y != -1) TouchY = (short)(Y * RatioHeight);

TrackPadTouch0.X = TouchX;
TrackPadTouch1.X = TouchX;

TrackPadTouch0.Y = TouchY;
TrackPadTouch1.Y = TouchY;

if (Button == 2097152) // MouseButtons.Right
{
OutputClickButton = false;
return;

if (X != -1) TouchX = (short)(X * RatioWidth);
if (Y != -1) TouchY = (short)(Y * RatioHeight);
}

TrackPadTouch0.RawTrackingNum = TOUCH0_ID + TOUCH_DISABLE;
TrackPadTouch1.RawTrackingNum = TOUCH1_ID + TOUCH_DISABLE;
Expand All @@ -61,15 +68,6 @@ public void OnMouseUp(short X, short Y, int Button)

public void OnMouseDown(short X, short Y, int Button)
{
if (Button == 2097152) // MouseButtons.Right
{
OutputClickButton = true;
return;
}

TrackPadTouch0.RawTrackingNum = TOUCH0_ID;
TrackPadTouch1.RawTrackingNum = TOUCH1_ID;

TouchX = (short)(X * RatioWidth);
TouchY = (short)(Y * RatioHeight);

Expand All @@ -78,12 +76,19 @@ public void OnMouseDown(short X, short Y, int Button)

TrackPadTouch0.Y = TouchY;
TrackPadTouch1.Y = TouchY;

if (Button == 2097152) // MouseButtons.Right
{
OutputClickButton = true;
return;
}

TrackPadTouch0.RawTrackingNum = TOUCH0_ID;
TrackPadTouch1.RawTrackingNum = TOUCH1_ID;
}

public void OnMouseMove(short X, short Y, int Button)
{
OutputClickButton = false;

TouchX = (short)(X * RatioWidth);
TouchY = (short)(Y * RatioHeight);

Expand Down

0 comments on commit 24f1a78

Please sign in to comment.