0

I'm new to pygame. I need to make a DualShock 4 controller rumble via BlueTooth. I know that the .rumble(low_frequency, high_frequency, duration) makes the controller rumble, and it works for me, but only when I connect my DualShock4 via USB. When I connect it with BlueTooth, the function returns False, and it doesn't work. Why is this, and how do I fix it, if possible? I am on Windows 11, and all my bluetooth drivers are up to date.

Rabbid76
  • 202,892
  • 27
  • 131
  • 174
Habeb
  • 1
  • 1
  • 1
    Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. – Community Apr 21 '23 at 16:53

1 Answers1

0

I found the solution. If I add these two lines of code:

import os
os.environ['SDL_JOYSTICK_HIDAPI_PS4_RUMBLE'] = '1'

The rumbling works, even via BlueTooth. Check this Reddit answer for more details: https://www.reddit.com/r/pygame/comments/12twl0e/cannot_rumble_dualshock_4_via_bluetooth_in_pygame/

Habeb
  • 1
  • 1