Skip to content

on iPhone gamepad is connecting but no event #1

Open

Description

@amitu
screen showing Gamepad connected: DUALSHOCK 4 Wireless Controller Extended Gamepad (id: 0) in console

gamepad tester websites show most of gamepad controls working so its not safari / gamepad etc issue, its our code.

Activity

  1. amitu commented on Dec 15, 2025

    @amitu
    ContributorAuthor

    Investigation Summary

    What we tested

    • iPhone with DualShock 4 controller connected via Bluetooth
    • iOS Safari accessing the app via HTTPS (ngrok tunnel)
    • Tested against third-party gamepad tester websites for comparison

    Observations

    1. Gamepad is detected correctly: Gamepad connected: DUALSHOCK 4 Wireless Controller Extended Gamepad (id: 0),
      axes: 4, buttons: 17
    2. Gamepad state never updates:
      - gamepad.timestamp() is always 0
      - Axis values remain at initial state [0.0, -0.0, 0.0, -0.0]
      - Button presses not detected
    3. Third-party gamepad tester sites also stopped working after navigating between tabs/sites - the gamepad appears
      to get into a "stale" state where it's connected but not updating

    Root cause

    This appears to be a known iOS Safari/WebKit bug. The Gamepad API detects the controller but doesn't properly
    update the gamepad state after initial connection. References:

    Current status

    • Gamepad works on desktop browsers (tested on Mac)
    • iOS Safari gamepad support is broken due to WebKit bugs

    Future investigation ideas

    1. Try using gamepadconnected/gamepaddisconnected events instead of/in addition to polling navigator.getGamepads()
    2. Test on different iOS versions to see if newer Safari versions have fixes
    3. Check if there's a specific user gesture requirement to "activate" gamepad input on iOS
    4. Compare our implementation with working gamepad tester sites' JavaScript to see if they use a different approach
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    wontfixThis will not be worked on

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions