mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-05-30 16:37:39 +00:00
Added common controllers used with Steam Big Picture
These are entirely untested Several USB ids refer to multiple packaged products. In those cases I tried to use the most common name, or a general name (e.g. PS3 Controller), or a completely generic name (e.g. USB gamepad) if it wasn't clear what type of controller it was. Patches welcome!
This commit is contained in:
parent
63317dfb17
commit
1205978244
2 changed files with 183 additions and 31 deletions
|
@ -27,16 +27,28 @@ def save_controller(line):
|
|||
def write_controllers():
|
||||
global controllers
|
||||
global controller_guids
|
||||
for entry in sorted(controllers, key=lambda entry: entry[2]):
|
||||
# Check for duplicates
|
||||
for entry in controllers:
|
||||
if (entry[1] in controller_guids):
|
||||
current_name = entry[2]
|
||||
existing_name = controller_guids[entry[1]][2]
|
||||
print("Warning: entry '%s' is duplicate of entry '%s'" % (current_name, existing_name))
|
||||
|
||||
if (not current_name.startswith("(DUPE)")):
|
||||
entry[2] = "(DUPE) " + current_name
|
||||
|
||||
if (not existing_name.startswith("(DUPE)")):
|
||||
controller_guids[entry[1]][2] = "(DUPE) " + existing_name
|
||||
|
||||
controller_guids[entry[1]] = entry
|
||||
|
||||
for entry in sorted(controllers, key=lambda entry: entry[2]+"-"+entry[1]):
|
||||
line = "".join(entry) + "\n"
|
||||
line = line.replace("\t", " ")
|
||||
if not line.endswith(",\n") and not line.endswith("*/\n"):
|
||||
print("Warning: '%s' is missing a comma at the end of the line" % (line))
|
||||
if (entry[1] in controller_guids):
|
||||
print("Warning: entry '%s' is duplicate of entry '%s'" % (entry[2], controller_guids[entry[1]][2]))
|
||||
controller_guids[entry[1]] = entry
|
||||
|
||||
output.write(line)
|
||||
|
||||
controllers = []
|
||||
controller_guids = {}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue