File tree Expand file tree Collapse file tree 1 file changed +6
-9
lines changed
src/hhd/controller/virtual/sinput Expand file tree Collapse file tree 1 file changed +6
-9
lines changed Original file line number Diff line number Diff 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 ]
You can’t perform that action at this time.
0 commit comments