Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5942)

Unified Diff: content/browser/gamepad/gamepad_standard_mappings_mac.mm

Issue 11886067: Added correct Mac mappings for the DragonRise Generic USB Gamepad. (Closed) Base URL: https://src.chromium.org/chrome/trunk/src/
Patch Set: Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « AUTHORS ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/gamepad/gamepad_standard_mappings_mac.mm
===================================================================
--- content/browser/gamepad/gamepad_standard_mappings_mac.mm (revision 176684)
+++ content/browser/gamepad/gamepad_standard_mappings_mac.mm (working copy)
@@ -171,12 +171,26 @@
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
« no previous file with comments | « AUTHORS ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698