• Jose Torreguitar's avatar
    Use proper mappings for all Xbox Elite controllers · eef4e6c1
    Jose Torreguitar authored
    The modern Xbox Elite Series 2 controller firmware reports on less axes
    than the previous firmware. However, the only way to distinguish between
    firmware versions is to check the length of the axes reported.
    
    This change updates the mapping function to work for all firmware
    versions by checking the axes length. On the older firmware, the axes
    are shifted by one after axis 3 because axes 4 and 9 are redundancies.
    
    BUG=1052543
    TEST=Testing this requires two Xbox elite series 2 controllers, one with
         modern firmware and one with release firmware. When using them on
         production code users will notice that on pressing the DPAD on
         modern firmware either the triggers or the opposing dpad axis is
         pressed.
    
    Change-Id: Ie51fd897a14180d664463d196b2fe744338c61c7
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2057624Reviewed-by: default avatarOvidio de Jesús Ruiz-Henríquez <odejesush@chromium.org>
    Reviewed-by: default avatarBrandon Jones <bajones@chromium.org>
    Commit-Queue: José Torreguitar <jtguitar@google.com>
    Cr-Commit-Position: refs/heads/master@{#742235}
    eef4e6c1
gamepad_standard_mappings_linux.cc 44.3 KB