mirror of
https://github.com/libretro/RetroArch.git
synced 2026-11-13 04:51:38 -10:00
Some controllers reach the OS as more than one input device: the Xperia Play's pad is two, the SHIELD keeps its NVIDIA button apart, the GPD XD its back button, the ARCHOS GamePad its sticks. The Android driver merged them with two global ids, pad_id1 and pad_id2, in a chain of special cases: one such device at a time, two members at most, and nothing done when one went away. A device group (input/input_group.h) is one pad made of several OS devices. The first member to arrive has the slot, later ones are read as it, in either order. A member leaving keeps the pad; the lead leaving hands the slot to the next member; the last leaving ends the group. Several groups stand at once. A rule names the model, the members' names and each one's role: part of the pad, the controller proper (a second controller is a pad of its own), or a part that only joins, like the NVIDIA button. The Android driver's special cases are now a rule table (android_groups.h) and the two globals are gone. input_group_test holds the table to the old chain on every model and name it tries, and the groups to join orders, members leaving, two groups at once and roles.