Skip to content

Commit

Permalink
Added correct Mac mappings for the DragonRise Generic USB Gamepad.
Browse files Browse the repository at this point in the history
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
  • Loading branch information
sylvinus@gmail.com committed Jan 16, 2013
1 parent f41c1d0 commit a0141b0
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -218,3 +218,4 @@ Kamil Jiwa <kamil.jiwa@gmail.com>
Keene Pan <keenepan@linpus.com>
Trevor Perrin <unsafe@trevp.net>
Ion Rosca <rosca@adobe.com>
Sylvain Zimmer <sylvinus@gmail.com>
14 changes: 14 additions & 0 deletions content/browser/gamepad/gamepad_standard_mappings_mac.mm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a0141b0

Please sign in to comment.