Skip to content

Commit ee1a1f5

Browse files
committed
update vid pid and fix minor issues
1 parent dfdf3df commit ee1a1f5

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

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

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ def __init__(
8686
paddles,
8787
)
8888

89-
self.version = 2
89+
self.version = 1
9090
if self.version == 2:
9191
self.axis = SINPUT_AXIS_MAP_V2
9292
else:
@@ -117,8 +117,8 @@ def open(self) -> Sequence[int]:
117117
cached.close(True, in_cache=True)
118118
if not self.dev:
119119
self.dev = UhidDevice(
120-
vid=0x2E8A,
121-
pid=0x10C6,
120+
vid=0x16D0,
121+
pid=0x145B,
122122
bus=BUS_USB,
123123
version=256,
124124
country=0,
@@ -229,8 +229,7 @@ def _prepare_features(self, feat: bool) -> bytearray:
229229
feats[ofs + 23] = (
230230
self.enable_touchpad * 0x01 + 0x10 + self.enable_rgb * 0x20
231231
)
232-
233-
case _:
232+
case 0 | 1:
234233
# Protocol version
235234
feats[ofs : ofs + 2] = (0x01, 0x00)
236235

@@ -252,11 +251,9 @@ def _prepare_features(self, feat: bool) -> bytearray:
252251
feats[ofs + 10 : ofs + 12] = int.to_bytes(GYRO_MAX_DPS, 2, "little")
253252

254253
bmask = get_button_mask(ofs + 12)
255-
self.btns = SINPUT_AVAILABLE_BUTTONS[gtype]
256-
for key in self.btns:
257-
set_button(feats, bmask[key], True)
258-
259254
serial_ofs = ofs + 18
255+
case _:
256+
raise ValueError(f"Unsupported SInput version {self.version}.")
260257

261258
# Set button mask
262259
self.btns = SINPUT_AVAILABLE_BUTTONS[gtype]

0 commit comments

Comments
 (0)