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

Unified Diff: content/browser/gamepad/gamepad_standard_mappings_linux.cc

Issue 10832231: Add gamepad mapping for XFXforce XGEAR PS2 Controller on Linux (Closed) Base URL: svn://svn.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
« 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_linux.cc
diff --git a/content/browser/gamepad/gamepad_standard_mappings_linux.cc b/content/browser/gamepad/gamepad_standard_mappings_linux.cc
index a7ba252741869ff96fd70d320e3d9fcdc95777a8..5da4103e3a03846c4df8d4d4772004a0771684f8 100644
--- a/content/browser/gamepad/gamepad_standard_mappings_linux.cc
+++ b/content/browser/gamepad/gamepad_standard_mappings_linux.cc
@@ -90,6 +90,29 @@ void MapperPlaystationSixAxis(
mapped->axesLength = kNumAxes;
}
+void MapperXGEAR(
+ const WebKit::WebGamepad& input,
+ WebKit::WebGamepad* mapped) {
+ *mapped = input;
+ mapped->buttons[kButtonPrimary] = input.buttons[2];
+ mapped->buttons[kButtonSecondary] = input.buttons[1];
+ mapped->buttons[kButtonTertiary] = input.buttons[3];
+ mapped->buttons[kButtonQuaternary] = input.buttons[0];
+ mapped->buttons[kButtonLeftShoulder] = input.buttons[6];
+ mapped->buttons[kButtonRightShoulder] = input.buttons[7];
+ mapped->buttons[kButtonLeftTrigger] = input.buttons[4];
+ mapped->buttons[kButtonRightTrigger] = input.buttons[5];
+ mapped->buttons[kButtonDpadUp] = AxisNegativeAsButton(input.axes[5]);
+ mapped->buttons[kButtonDpadDown] = AxisPositiveAsButton(input.axes[5]);
+ mapped->buttons[kButtonDpadLeft] = AxisNegativeAsButton(input.axes[4]);
+ mapped->buttons[kButtonDpadRight] = AxisPositiveAsButton(input.axes[4]);
+ mapped->axes[kAxisRightStickX] = input.axes[3];
+ mapped->axes[kAxisRightStickY] = input.axes[2];
+ mapped->buttonsLength = kNumButtons - 1; // no Meta on this device
+ mapped->axesLength = kNumAxes;
+}
+
+
struct MappingData {
const char* const vendor_id;
const char* const product_id;
@@ -103,6 +126,7 @@ struct MappingData {
{ "046d", "c21f", MapperXInputStyleGamepad }, // Logitech F710
{ "054c", "0268", MapperPlaystationSixAxis }, // Playstation SIXAXIS
{ "0925", "8866", MapperMP8866 }, // WiseGroup MP-8866
+ { "0e8f", "0003", MapperXGEAR }, // XFXforce XGEAR PS2 Controller
};
} // 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