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

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

Issue 12917009: Added a mapping for the Logitech Extreme 3D Pro joystick to the DirectInput whitelist. This way, W… (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: Created 7 years, 9 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_win.cc
===================================================================
--- content/browser/gamepad/gamepad_standard_mappings_win.cc (revision 188613)
+++ content/browser/gamepad/gamepad_standard_mappings_win.cc (working copy)
@@ -78,6 +78,39 @@
mapped->axesLength = 0;
}
+void MapperLogitechExtreme3DPro(
+ const WebKit::WebGamepad& input,
+ WebKit::WebGamepad* mapped) {
+ *mapped = input;
+ mapped->buttons[kButtonPrimary] = input.buttons[0];
+ mapped->buttons[kButtonSecondary] = input.buttons[1];
+ mapped->buttons[kButtonTertiary] = input.buttons[2];
+ mapped->buttons[kButtonQuaternary] = input.buttons[3];
+ mapped->buttons[kButtonLeftShoulder] = 4;
scottmg 2013/03/18 17:29:43 I'm assuming these two lines are incorrect.
+ mapped->buttons[kButtonRightShoulder] = 5;
+
+ mapped->buttons[kButtonLeftTrigger] = 0;
+ mapped->buttons[kButtonRightTrigger] = 0;
+ mapped->buttons[kButtonBackSelect] = 0;
+ mapped->buttons[kButtonStart] = 0;
+ mapped->buttons[kButtonLeftThumbstick] = 0;
+ mapped->buttons[kButtonRightThumbstick] = 0;
+
+ mapped->buttons[kButtonDpadUp] = 0;
+ mapped->buttons[kButtonDpadDown] = 0;
+ mapped->buttons[kButtonDpadLeft] = 0;
+ mapped->buttons[kButtonDpadRight] = 0;
+ mapped->buttons[kButtonMeta] = 0;
+
+ mapped->axes[0] = NormalizeDirectInputAxis(input.axes[0]);
+ mapped->axes[1] = NormalizeDirectInputAxis(input.axes[1]);
+ mapped->axes[2] = NormalizeDirectInputAxis(input.axes[5]);
+ mapped->axes[3] = NormalizeDirectInputAxis(input.axes[2]);
+
+ mapped->buttonsLength = 16;
+ mapped->axesLength = 4;
+}
+
void Mapper2Axes8Keys(
const WebKit::WebGamepad& input,
WebKit::WebGamepad* mapped) {
@@ -105,6 +138,7 @@
{ "0079", "0006", MapperDragonRiseGeneric }, // DragonRise Generic USB
{ "046d", "c216", MapperLogitechDualAction }, // Logitech DualAction
{ "046d", "c21a", MapperLogitechPrecision }, // Logitech Precision
+ { "046d", "c215", MapperLogitechExtreme3DPro }, // Logitech Extreme 3D Pro
{ "12bd", "d012", Mapper2Axes8Keys }, // 2Axes 8Keys Game Pad
};
« no previous file with comments | « AUTHORS ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698