diff options
author | sylvinus@gmail.com <sylvinus@gmail.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-01-16 20:43:32 +0000 |
---|---|---|
committer | sylvinus@gmail.com <sylvinus@gmail.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-01-16 20:43:32 +0000 |
commit | a0141b0b9ce408c3edb11a127cb03be7d300fdf3 (patch) | |
tree | 4e17fc2755233c8474d3106dfebea38363f6a5cc /content/browser/gamepad | |
parent | f41c1d0944fb943048d1eb2af850d4934b5befe0 (diff) | |
download | chromium_src-a0141b0b9ce408c3edb11a127cb03be7d300fdf3.zip chromium_src-a0141b0b9ce408c3edb11a127cb03be7d300fdf3.tar.gz chromium_src-a0141b0b9ce408c3edb11a127cb03be7d300fdf3.tar.bz2 |
Added correct Mac mappings for the DragonRise Generic USB Gamepad.
BUG=167228
Review URL: https://chromiumcodereview.appspot.com/11886067
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@177212 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/browser/gamepad')
-rw-r--r-- | content/browser/gamepad/gamepad_standard_mappings_mac.mm | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/content/browser/gamepad/gamepad_standard_mappings_mac.mm b/content/browser/gamepad/gamepad_standard_mappings_mac.mm index 5349230..0ffb35f 100644 --- a/content/browser/gamepad/gamepad_standard_mappings_mac.mm +++ b/content/browser/gamepad/gamepad_standard_mappings_mac.mm @@ -171,12 +171,26 @@ void MapperSmartJoyPLUS( mapped->axesLength = kNumAxes; } +void MapperDragonRiseGeneric( + const WebKit::WebGamepad& input, + WebKit::WebGamepad* mapped) { + *mapped = input; + DpadFromAxis(mapped, input.axes[9]); + mapped->axes[kAxisLeftStickX] = input.axes[0]; + mapped->axes[kAxisLeftStickY] = input.axes[1]; + mapped->axes[kAxisRightStickX] = input.axes[2]; + mapped->axes[kAxisRightStickY] = input.axes[5]; + mapped->buttonsLength = kNumButtons - 1; /* no meta */ + mapped->axesLength = kNumAxes; +} + struct MappingData { const char* const vendor_id; const char* const product_id; GamepadStandardMappingFunction function; } AvailableMappings[] = { // http://www.linux-usb.org/usb.ids + { "0079", "0006", MapperDragonRiseGeneric }, // DragonRise Generic USB { "045e", "028e", MapperXbox360Gamepad }, // Xbox 360 Controller { "045e", "028f", MapperXbox360Gamepad }, // Xbox 360 Wireless Controller { "046d", "c216", MapperDirectInputStyle }, // Logitech F310, D mode |