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

Unified Diff: device/gamepad/gamepad_standard_mappings_mac.mm

Issue 2798933004: Restore mappings for older Xbox One S Bluetooth gamepads on OSX/Linux (Closed)
Patch Set: re-add old firmware mappings Created 3 years, 5 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 | « device/gamepad/gamepad_standard_mappings_linux.cc ('k') | 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 27e12ce6898b507a4bddf67ad7dbf43ddf797458..8d358dfc09544067de080d29026eb58d3a180734 100644
--- a/device/gamepad/gamepad_standard_mappings_mac.mm
+++ b/device/gamepad/gamepad_standard_mappings_mac.mm
@@ -30,7 +30,29 @@ void MapperXbox360Gamepad(const Gamepad& input, Gamepad* mapped) {
mapped->axes_length = AXIS_INDEX_COUNT;
}
-void MapperXboxOneHidGamepad(const Gamepad& input, Gamepad* mapped) {
+void MapperXboxOneS2016Firmware(const Gamepad& input, Gamepad* mapped) {
+ *mapped = input;
+ mapped->buttons[BUTTON_INDEX_PRIMARY] = input.buttons[0];
+ mapped->buttons[BUTTON_INDEX_SECONDARY] = input.buttons[1];
+ mapped->buttons[BUTTON_INDEX_TERTIARY] = input.buttons[2];
+ mapped->buttons[BUTTON_INDEX_QUATERNARY] = input.buttons[3];
+ mapped->buttons[BUTTON_INDEX_LEFT_SHOULDER] = input.buttons[4];
+ mapped->buttons[BUTTON_INDEX_RIGHT_SHOULDER] = input.buttons[5];
+ 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->buttons_length = BUTTON_INDEX_COUNT - 1; /* no meta */
+ mapped->axes_length = AXIS_INDEX_COUNT;
+}
+
+void MapperXboxOneS(const Gamepad& input, Gamepad* mapped) {
*mapped = input;
mapped->buttons[BUTTON_INDEX_PRIMARY] = input.buttons[0];
@@ -374,9 +396,10 @@ struct MappingData {
{"045e", "028f", MapperXbox360Gamepad}, // Xbox 360 Wireless
{"045e", "02d1", MapperXbox360Gamepad}, // Xbox One Wired
{"045e", "02dd", MapperXbox360Gamepad}, // Xbox One Wired (2015 FW)
+ {"045e", "02e0", MapperXboxOneS2016Firmware}, // Xbox One S (Bluetooth)
{"045e", "02e3", MapperXbox360Gamepad}, // Xbox One Elite Wired
{"045e", "02ea", MapperXbox360Gamepad}, // Xbox One S (USB)
- {"045e", "02fd", MapperXboxOneHidGamepad}, // Xbox One S (Bluetooth)
+ {"045e", "02fd", MapperXboxOneS}, // Xbox One S (Bluetooth)
{"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 | « device/gamepad/gamepad_standard_mappings_linux.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698