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

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

Issue 10854107: Add linux/mac gamepad mappings for SmartJoy PLUS adapter. (Closed) Base URL: https://src.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 4 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
Index: content/browser/gamepad/gamepad_standard_mappings_mac.mm
===================================================================
--- content/browser/gamepad/gamepad_standard_mappings_mac.mm (revision 151200)
+++ content/browser/gamepad/gamepad_standard_mappings_mac.mm (working copy)
@@ -152,6 +152,25 @@
mapped->axesLength = kNumAxes;
}
+void MapperSmartJoyPLUS(
+ const WebKit::WebGamepad& input,
+ WebKit::WebGamepad* mapped) {
+ *mapped = input;
+ mapped->buttons[kButtonPrimary] = input.buttons[2];
+ mapped->buttons[kButtonTertiary] = input.buttons[3];
+ mapped->buttons[kButtonQuaternary] = input.buttons[0];
+ mapped->buttons[kButtonStart] = input.buttons[8];
+ mapped->buttons[kButtonBackSelect] = input.buttons[9];
+ mapped->buttons[kButtonLeftShoulder] = input.buttons[6];
+ mapped->buttons[kButtonRightShoulder] = input.buttons[7];
+ mapped->buttons[kButtonLeftTrigger] = input.buttons[4];
+ mapped->buttons[kButtonRightTrigger] = input.buttons[5];
+ DpadFromAxis(mapped, input.axes[9]);
+ 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;
@@ -164,6 +183,7 @@
{ "046d", "c218", MapperDirectInputStyle }, // Logitech F510, D mode
{ "046d", "c219", MapperDirectInputStyle }, // Logitech F710, D mode
{ "054c", "0268", MapperPlaystationSixAxis }, // Playstation SIXAXIS
+ { "0925", "0005", MapperSmartJoyPLUS }, // SmartJoy PLUS Adapter
{ "0e8f", "0003", MapperXGEAR }, // XFXforce XGEAR PS2 Controller
{ "2222", "0060", MapperDirectInputStyle }, // Macally iShockX, analog mode
{ "2222", "4010", MapperMacallyIShock }, // Macally iShock

Powered by Google App Engine
This is Rietveld 408576698