PsychoPy not detecting joystick in 2025.x.x

If this template helps then use it. If not then just delete and start from scratch.

OS (e.g. Win10): Windows 11 Enterprise 26100.7623
PsychoPy version (e.g. 2024.2.4 Py 3.8): 2025.2.4beta, Python 3.10.11, pygame 2.6.1 (SDL 2.28.4)
Standard Standalone Installation? (y/n) Yes
Do you want it to also run online? (y/n) No
What are you trying to achieve?: Use my joystick in 2025.1.1 Py 3.8, or 2025.x.x Py3.10

Hi all, I’m running into a joystick‑detection issue that I can’t resolve, and I’d appreciate guidance on whether this is a configuration problem on my end or a regression in recent PsychoPy releases. My same joystick worked in the past on the same PC with older 2024.x.x PsychoPy installs. Windows and other applications detect the joystick and all buttons as expected.

What did you try to make it work?

  1. Tried to produce a minimal task example in 2025.1.1 Py 3.8, and 2025.2.4 Py3.10, that contains only a single joystick component. Here the error is ERROR No joystick/gamepad device found
  2. I tested whether I could detect the joystick in a single code component in PsychoPy 2025.2.4 using count = joysticklib.getNumJoysticks(), but I get:
    AttributeError: module psychopy.hardware.joystick’ has no attribute ‘getNumJoysticks’. Did you mean: getAllJoysticks’?. Changing the code component to count = joysticklib.getAllJoysticks() results in [{‘index’: 0, ‘name’: ‘Logitech Attack 3’}]. However, if I add in a joystick component the No joystick/gamepad device found error occurs.
  3. I looked in the python script generated by the minimal task example, and the error appears to relate to a flag included by the joystick component where joysticklib.getNumJoysticks() is not detecting the joystick (below):
    # Start Code - component code to be run after the window creation
    from psychopy.hardware import joystick as joysticklib  # joystick/gamepad accsss
    from psychopy.experiment.components.joystick import virtualJoystick as virtualjoysticklib
    from psychopy.hardware import joystick as joysticklib  # joystick/gamepad accsss
    from psychopy.experiment.components.joyButtons import virtualJoyButtons as virtualjoybuttonslib
    
    # --- Initialize components for Routine "joy" ---
    x, y = [None, None]
    joystick = type('', (), {})() # Create an object to use as a name space
    joystick.device = None
    joystick.device_number = 0
    joystick.joystickClock = core.Clock()
    joystick.xFactor = 1
    joystick.yFactor = 1
    
    try:
        numJoysticks = joysticklib.getNumJoysticks()
        if numJoysticks > 0:
            try:
                joystickCache
            except NameError:
                joystickCache={}
            if not 0 in joystickCache:
                joystickCache[0] = joysticklib.Joystick(0)
            joystick.device = joystickCache[0]
            if win.units == 'height':
                joystick.xFactor = 0.5 * win.size[0]/win.size[1]
                joystick.yFactor = 0.5
        else:
            joystick.device = virtualjoysticklib.VirtualJoystick(0)
            logging.warning("joystick_{}: Using keyboard+mouse emulation 'ctrl' + 'Alt' + digit.".format(joystick.device_number))
    except Exception:
        pass
        
    if not joystick.device:
        logging.error('No joystick/gamepad device found.')
        core.quit()
  1. I tried to locate or add the joystick device in PsychoPy 2025.2.5 new Device Manager option - but the joystick is not listed.
  2. I tested whether pygame could detect the joystick using PsychoPy’s python install accessed via the command line. pygame.joystick.init() detected the joystick :+1:
  3. I have tried running an old task (built with 2024.2.4 Py 3.8) where the same joystick did work on the same PC (when 2024.x.x was current) using 2025.1.1 Py3.8 and 2025.2.4 Py 3.10 builds with UseVersion set to blank. Here the error is also ERROR No joystick/gamepad device found.
  4. I have tried running the same old task as above, using 2025.1.1 Py3.8 and 2025.2.4 Py 3.10 builds with UseVersion set to 2024.2.4. This was not possible due to problems with other errors indicating python modules not being found on experiment start (several X module was not found errors).
  5. I have tried running the same old task as above, by downloading and using 2024.2.4 Py3.8. However this again was not possible due to problems with other errors indicating python modules not being found on experiment start (several X module was not found errors).

Link to the most relevant existing thread you have found: I could not find any joystick posts related to detection errors on this forum. But I notice this recent changelog for 2025.2.4 Py3.10 describing “Fixed incorrect func ref in getAllJoysticks()". I’m sorry, I cant tell if it is relevant though - Click here

Could someone please advise on:
• whether this is a known regression in joystick handling for PsychPy 2025.x.x
• any recommended diagnostics
• whether device support/management in PsychoPy has changed in a way that would affect USB joystick devices

I’m happy to provide logs, hardware IDs, or run any additional tests that would help. Thanks very much for your time! :blush: