Skip to content

Commit 125788e

Browse files
authored
Add setRumble and isConnected to CommandGenericHID (#68)
1 parent 3eac469 commit 125788e

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

Diff for: commands2/button/commandgenerichid.py

+18
Original file line numberDiff line numberDiff line change
@@ -186,3 +186,21 @@ def getRawAxis(self, axis: int) -> float:
186186
:returns: The value of the axis.
187187
"""
188188
return self._hid.getRawAxis(axis)
189+
190+
def setRumble(self, type: GenericHID.RumbleType, value: float):
191+
"""
192+
Set the rumble output for the HID.
193+
The DS currently supports 2 rumble values, left rumble and right rumble.
194+
195+
:param type: Which rumble value to set.
196+
:param value: The normalized value (0 to 1) to set the rumble to.
197+
"""
198+
self._hid.setRumble(type, value)
199+
200+
def isConnected(self):
201+
"""
202+
Get if the HID is connected.
203+
204+
:returns: True if the HID is connected.
205+
"""
206+
return self._hid.isConnected()

0 commit comments

Comments
 (0)