Skip to content

Add setRumble and isConnected to CommandGenericHID #68

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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()
Loading