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

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

Issue 10832162: Add support for Macally iShock. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: space 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
« no previous file with comments | « no previous file | 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
diff --git a/content/browser/gamepad/gamepad_standard_mappings_mac.mm b/content/browser/gamepad/gamepad_standard_mappings_mac.mm
index 4c33ef6656a0ab1ec3ccbb089ffc8e9c8476cb88..2c471a248f1f42eb6c880034d4b2d0e86004a2d2 100644
--- a/content/browser/gamepad/gamepad_standard_mappings_mac.mm
+++ b/content/browser/gamepad/gamepad_standard_mappings_mac.mm
@@ -93,6 +93,46 @@ void MapperDirectInputStyle(
mapped->axesLength = kNumAxes;
}
+void MapperMacallyIShock(
+ const WebKit::WebGamepad& input,
+ WebKit::WebGamepad* mapped) {
+ enum IShockButtons {
+ kButtonC = kNumButtons,
+ kButtonD,
+ kButtonE,
+ kNumIShockButtons
+ };
+
+ *mapped = input;
+ mapped->buttons[kButtonPrimary] = input.buttons[6];
+ mapped->buttons[kButtonSecondary] = input.buttons[5];
+ mapped->buttons[kButtonTertiary] = input.buttons[7];
+ mapped->buttons[kButtonQuaternary] = input.buttons[4];
+ mapped->buttons[kButtonLeftShoulder] = input.buttons[14];
+ mapped->buttons[kButtonRightShoulder] = input.buttons[12];
+ mapped->buttons[kButtonLeftTrigger] = input.buttons[15];
+ mapped->buttons[kButtonRightTrigger] = input.buttons[13];
+ mapped->buttons[kButtonBackSelect] = input.buttons[9];
+ mapped->buttons[kButtonStart] = input.buttons[10];
+ mapped->buttons[kButtonLeftThumbstick] = input.buttons[16];
+ mapped->buttons[kButtonRightThumbstick] = input.buttons[17];
+ mapped->buttons[kButtonDpadUp] = input.buttons[0];
+ mapped->buttons[kButtonDpadDown] = input.buttons[1];
+ mapped->buttons[kButtonDpadLeft] = input.buttons[2];
+ mapped->buttons[kButtonDpadRight] = input.buttons[3];
+ mapped->buttons[kButtonMeta] = input.buttons[11];
+ mapped->buttons[kButtonC] = input.buttons[8];
+ mapped->buttons[kButtonD] = input.buttons[18];
+ mapped->buttons[kButtonE] = input.buttons[19];
+ mapped->axes[kAxisLeftStickX] = input.axes[0];
+ mapped->axes[kAxisLeftStickY] = input.axes[1];
+ mapped->axes[kAxisRightStickX] = -input.axes[5];
+ mapped->axes[kAxisRightStickY] = input.axes[6];
+
+ mapped->buttonsLength = kNumIShockButtons;
+ mapped->axesLength = kNumAxes;
+}
+
struct MappingData {
const char* const vendor_id;
const char* const product_id;
@@ -106,6 +146,7 @@ struct MappingData {
{ "046d", "c219", MapperDirectInputStyle }, // Logitech F710, D mode
{ "054c", "0268", MapperPlaystationSixAxis }, // Playstation SIXAXIS
{ "2222", "0060", MapperDirectInputStyle }, // Macally iShockX, analog mode
+ { "2222", "4010", MapperMacallyIShock }, // Macally iShock
};
} // namespace
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698