ApproxEng / approxeng.input

Python classes to handle game controllers, including PS3, PS4, XBox One and Rock Candy
https://approxeng.github.io/approxeng.input
Apache License 2.0
55 stars 17 forks source link

Ensure keys in sys.__CACHED_SCAN__ are in upper case #51

Closed mjkaye closed 8 months ago

mjkaye commented 3 years ago

Ensure keys in sys.__CACHED_SCAN__ are upper case so that they match device_unique_name.

I had an issue when reading my controller's LEDs. This was due to the fact that the keys in sys.CACHED_SCAN were lower case, but the ID being passed into read_led_value was upper case. This PR makes sure that the keys in sys.CACHED_SCAN are always upper case.

tomoinn commented 3 years ago

I'm not convinced this is a good approach - rewriting only in this single place will cause other controllers to fail to match. A proper way to deal with this would be to make keys in the sys module case insensitive, rather than forcing what is effectively an incorrect case sensitive comparison.