• Matt Reynolds's avatar
    Allow Chrome on Mac to recognize multiple MFi gamepads · f3f5e27d
    Matt Reynolds authored
    Chrome for Mac recognizes "Made for iOS" (MFi) gamepads enumerated
    by the GameController framework. When multiple such devices are
    connected at once, Chrome fails to properly distinguish them.
    
    GCController exposes a playerIndex field that defaults to the value
    GCControllerPlayerIndexUnset (-1). The application may set this field
    to a value between 0 and 3 to signal which LEDs should be lit on the
    gamepad. Chrome also uses this field to distinguish gamepads, but does
    not set the index to a unique value. This causes the first-connected
    gamepad to shadow any other connected gamepads.
    
    This CL ensures each connected MFi gamepad is assigned a unique player
    index up to the OS-defined limit of four.
    
    BUG=775270
    
    Change-Id: Ieb852cadc5ff36f94aa1003de3f2e13538114661
    Reviewed-on: https://chromium-review.googlesource.com/723852Reviewed-by: default avatarBrandon Jones <bajones@chromium.org>
    Commit-Queue: Matt Reynolds <mattreynolds@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#509533}
    f3f5e27d
game_controller_data_fetcher_mac.mm 5.12 KB