Gamepad: Improve gamepad mapping code and unknown gamepad heuristics
This CL modifies the GamepadMappings class to use subclasses for mappings rather than static methods. The advantage is that the unknown gamepad mapping can keep state around that allows it to create heuristic mappings at GamepadDevice constrution time. This allows stable mappings that don't depend on input to decide correctly. This also means we aren't doing string parsing on each gamepad event anymore. With this change, Moga Pro, Nexus Player (ASUS) Gamepad, and Razer Serval controllers are working correctly without explict mappings. Before the change, the D-Pad on Moga, Serval, and ASUS Gamepad were non-functional. The triggers on the Moga didn't work at all, and the Serval and ASUS Gamepad's triggers were swapped with the shoulder buttons. TEST=http://html5gamepad.com/ BUG=615656 Review-Url: https://codereview.chromium.org/2071223002 Cr-Commit-Position: refs/heads/master@{#419372}
Showing
This diff is collapsed.
Please register or sign in to comment