xbmc / peripheral.joystick

Kodi joystick support (drivers and button maps)
GNU General Public License v2.0
24 stars 46 forks source link

Peripheral API v3.0.2: Stable peripheral locations #294

Closed garbear closed 9 months ago

garbear commented 9 months ago

Description

This PR is the counterpart to https://github.com/xbmc/xbmc/pull/24392. It makes use of the new comparison operators to assign a stable peripheral index when a controller is unplugged/replugged.

However, if you have two identical controllers, and they are replugged in the opposite order, their locations will be swapped. This isn't too big of an issue, because if the controllers are identical the two players can simply swap them if needed.

An additional change is included for the Linux Joystick API driver. The comparison was breaking because replugging controllers in the wrong order assigns new /dev/input/js# filenames. As a result, the Linux driver instability would propagate to location instability.

How has this been tested?

Tested as part of https://github.com/xbmc/xbmc/pull/24392.