Try this: ``` def find_haptic_joystick(): for i in range(0, SDL_NumJoysticks()): joy = S

Try this:
def find_haptic_joystick():
    for i in range(0, SDL_NumJoysticks()):
        joy = SDL_JoystickOpen(i)
        try:
            if SDL_JoystickIsHaptic(joy):
                logging.info(f"Found FFB: {SDL_JoystickName(joy)} index {i}")
                break
        finally:
            SDL_JoystickClose(joy)
    return i
Was this page helpful?