Skip to content

Commit f2f9eb8

Browse files
committed
dualsense: fix dual touchpad contact bits in both-touching scenario
1 parent d56bf6a commit f2f9eb8

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/hhd/controller/virtual/dualsense/__init__.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -568,20 +568,20 @@ def write_tp(offset, x, y):
568568
# Right owns TP1: TP1 = right, TP2 = left
569569
tp1_x, tp1_y = self.right_touchpad_x, self.right_touchpad_y
570570
tp2_x, tp2_y = self.left_touchpad_x, self.left_touchpad_y
571-
tp1_is_left = False
572571
else: # "left"
573572
# Left owns TP1: TP1 = left, TP2 = right
574573
tp1_x, tp1_y = self.left_touchpad_x, self.left_touchpad_y
575574
tp2_x, tp2_y = self.right_touchpad_x, self.right_touchpad_y
576-
tp1_is_left = True
577575

578576
# Write both TP1 and TP2
579577
write_tp(self.ofs + 32, tp1_x, tp1_y)
580578
write_tp(self.ofs + 36, tp2_x, tp2_y)
581579

582-
# Set TP1 touch status if it's the left touchpad
583-
if tp1_is_left:
584-
new_rep[self.ofs + 32] = new_rep[self.ofs + 32] & 0x7F
580+
# Manually set both contact bits to "touching" (override default mapping)
581+
# This is necessary because the default mapping (touchpad_touch->TP1, left_touchpad_touch->TP2)
582+
# may not match the actual coordinate assignment when tp1_owner is "left"
583+
new_rep[self.ofs + 32] = new_rep[self.ofs + 32] & 0x7F # TP1 is touching
584+
new_rep[self.ofs + 36] = new_rep[self.ofs + 36] & 0x7F # TP2 is touching
585585
else:
586586
# Only one touching: behavior depends on mapping mode
587587
if self.touchpad_persistent_mapping:

0 commit comments

Comments
 (0)