Skip to content

Commit

Permalink
Add setRumble and isConnected to CommandGenericHID (#68)
Browse files Browse the repository at this point in the history
  • Loading branch information
spacey-sooty authored Jul 10, 2024
1 parent 3eac469 commit 125788e
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions commands2/button/commandgenerichid.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,3 +186,21 @@ def getRawAxis(self, axis: int) -> float:
:returns: The value of the axis.
"""
return self._hid.getRawAxis(axis)

def setRumble(self, type: GenericHID.RumbleType, value: float):
"""
Set the rumble output for the HID.
The DS currently supports 2 rumble values, left rumble and right rumble.
:param type: Which rumble value to set.
:param value: The normalized value (0 to 1) to set the rumble to.
"""
self._hid.setRumble(type, value)

def isConnected(self):
"""
Get if the HID is connected.
:returns: True if the HID is connected.
"""
return self._hid.isConnected()

0 comments on commit 125788e

Please sign in to comment.