Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions DS4Windows/DS4Control/Mouse.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ public class Mouse : ITouchpadBehaviour
public bool priorLeftDown, priorRightDown, priorUpperDown, priorMultiDown;
private bool touchStarted = false;
private bool touchEnded = false;
private bool touchStartedInPassthru = false;
protected DS4Controls pushed = DS4Controls.None;
protected Mapping.Click clicked = Mapping.Click.None;
public int CursorGyroDead { get => cursor.GyroCursorDeadZone; set => cursor.GyroCursorDeadZone = value; }
Expand Down Expand Up @@ -1103,7 +1104,7 @@ public virtual void touchesMoved(DS4Touchpad sender, TouchpadEventArgs arg)
TouchpadOutMode tempMode = Global.TouchOutMode[deviceNum];
if (tempMode == TouchpadOutMode.Mouse)
{
if (Global.GetTouchActive(deviceNum))
if (Global.GetTouchActive(deviceNum) && !touchStartedInPassthru)
{
int[] disArray = Global.getTouchDisInvertTriggers(deviceNum);
tempBool = true;
Expand Down Expand Up @@ -1157,7 +1158,7 @@ public virtual void touchesMoved(DS4Touchpad sender, TouchpadEventArgs arg)
}
else if (tempMode == TouchpadOutMode.AbsoluteMouse)
{
if (Global.GetTouchActive(deviceNum))
if (Global.GetTouchActive(deviceNum) && !touchStartedInPassthru)
{
cursor.TouchesMovedAbsolute(arg);
}
Expand Down Expand Up @@ -1658,6 +1659,7 @@ public virtual void touchUnchanged(DS4Touchpad sender, EventArgs unused)
private void TouchButtonUpFlags()
{
upperDown = leftDown = rightDown = multiDown = false;
touchStartedInPassthru = false;
touchButtonCurrentCandidate = TouchButtonModeCandidate.None;
}

Expand Down Expand Up @@ -1777,6 +1779,11 @@ private void TouchButtonCheckProcess(TouchpadEventArgs arg)

if (activateTouchButton)
{
if (Global.TouchOutMode[deviceNum] == TouchpadOutMode.Passthru)
{
touchStartedInPassthru = true;
}

switch (touchButtonCurrentCandidate)
{
case TouchButtonModeCandidate.Left:
Expand Down Expand Up @@ -1816,7 +1823,7 @@ private void synthesizeMouseButtons()
}

if (Global.GetDS4CSetting(deviceNum, DS4Controls.TouchLeft).IsDefault &&
leftDown)
leftDown && !touchStartedInPassthru)
{
Mapping.MapClick(deviceNum, Mapping.Click.Left);
dragging2 = true;
Expand Down