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

Unified Diff: device/gamepad/gamepad_standard_mappings_mac.mm

Issue 2314553002: Add mapping for the new Xbox One S controller in BT mode (Closed)
Patch Set: Created 4 years, 3 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: device/gamepad/gamepad_standard_mappings_mac.mm
diff --git a/device/gamepad/gamepad_standard_mappings_mac.mm b/device/gamepad/gamepad_standard_mappings_mac.mm
index 786ad3b5f99cfdcc5aa75af90c0202f04e8f318f..e8f2492ff9f758b2dd56cbaeb15f495967a52933 100644
--- a/device/gamepad/gamepad_standard_mappings_mac.mm
+++ b/device/gamepad/gamepad_standard_mappings_mac.mm
@@ -31,6 +31,23 @@ void MapperXbox360Gamepad(const blink::WebGamepad& input,
mapped->axesLength = AXIS_INDEX_COUNT;
}
+void MapperXboxOneHidGamepad(const blink::WebGamepad& input,
+ blink::WebGamepad* mapped) {
+ *mapped = input;
+ mapped->buttons[BUTTON_INDEX_LEFT_TRIGGER] = AxisToButton(input.axes[2]);
+ mapped->buttons[BUTTON_INDEX_RIGHT_TRIGGER] = AxisToButton(input.axes[5]);
+ mapped->buttons[BUTTON_INDEX_BACK_SELECT] = input.buttons[6];
+ mapped->buttons[BUTTON_INDEX_START] = input.buttons[7];
+ mapped->buttons[BUTTON_INDEX_LEFT_THUMBSTICK] = input.buttons[8];
+ mapped->buttons[BUTTON_INDEX_RIGHT_THUMBSTICK] = input.buttons[9];
+ mapped->axes[AXIS_INDEX_RIGHT_STICK_X] = input.axes[3];
+ mapped->axes[AXIS_INDEX_RIGHT_STICK_Y] = input.axes[4];
+ DpadFromAxis(mapped, input.axes[9]);
+
+ mapped->buttonsLength = BUTTON_INDEX_COUNT - 1; /* no meta */
+ mapped->axesLength = AXIS_INDEX_COUNT;
+}
+
void MapperPlaystationSixAxis(const blink::WebGamepad& input,
blink::WebGamepad* mapped) {
*mapped = input;
@@ -359,6 +376,7 @@ void MapperMogaPro(const blink::WebGamepad& input, blink::WebGamepad* mapped) {
{"0079", "0006", MapperDragonRiseGeneric}, // DragonRise Generic USB
{"045e", "028e", MapperXbox360Gamepad}, // Xbox 360 Wired
{"045e", "028f", MapperXbox360Gamepad}, // Xbox 360 Wireless
+ {"045e", "02e0", MapperXboxOneHidGamepad}, // Xbox One S (Bluetooth mode)
{"045e", "0719", MapperXbox360Gamepad}, // Xbox 360 Wireless
{"046d", "c216", MapperDirectInputStyle}, // Logitech F310, D mode
{"046d", "c218", MapperDirectInputStyle}, // Logitech F510, D mode
« 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