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

Unified Diff: device/gamepad/gamepad_standard_mappings_linux.cc

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 | « no previous file | device/gamepad/gamepad_standard_mappings_mac.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/gamepad/gamepad_standard_mappings_linux.cc
diff --git a/device/gamepad/gamepad_standard_mappings_linux.cc b/device/gamepad/gamepad_standard_mappings_linux.cc
index 17b8afc2430be671f62ba7780663147f958faaeb..fbf1d59e1fd67d9926aa5961da2cc6b2a030affa 100644
--- a/device/gamepad/gamepad_standard_mappings_linux.cc
+++ b/device/gamepad/gamepad_standard_mappings_linux.cc
@@ -31,7 +31,32 @@ void MapperXInputStyleGamepad(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->buttons[BUTTON_INDEX_DPAD_UP] = AxisNegativeAsButton(input.axes[7]);
+ mapped->buttons[BUTTON_INDEX_DPAD_DOWN] = AxisPositiveAsButton(input.axes[7]);
+ mapped->buttons[BUTTON_INDEX_DPAD_LEFT] = AxisNegativeAsButton(input.axes[6]);
+ mapped->buttons[BUTTON_INDEX_DPAD_RIGHT] =
+ AxisPositiveAsButton(input.axes[6]);
+ mapped->axes[AXIS_INDEX_RIGHT_STICK_X] = input.axes[3];
+ mapped->axes[AXIS_INDEX_RIGHT_STICK_Y] = input.axes[4];
+ 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];
@@ -352,9 +377,10 @@ struct MappingData {
{"045e", "02a1", MapperXInputStyleGamepad}, // Xbox 360 Wireless
{"045e", "02d1", MapperXInputStyleGamepad}, // Xbox One Wired
{"045e", "02dd", MapperXInputStyleGamepad}, // Xbox One Wired (2015 FW)
+ {"045e", "02e0", MapperXboxOneS2016Firmware}, // Xbox One S (Bluetooth)
{"045e", "02e3", MapperXInputStyleGamepad}, // Xbox One Elite Wired
{"045e", "02ea", MapperXInputStyleGamepad}, // Xbox One S (USB)
- {"045e", "02fd", MapperXboxOneHidGamepad}, // Xbox One S (Bluetooth)
+ {"045e", "02fd", MapperXboxOneS}, // Xbox One S (Bluetooth)
{"045e", "0719", MapperXInputStyleGamepad}, // Xbox 360 Wireless
{"046d", "c21d", MapperXInputStyleGamepad}, // Logitech F310
{"046d", "c21e", MapperXInputStyleGamepad}, // Logitech F510
« no previous file with comments | « no previous file | device/gamepad/gamepad_standard_mappings_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698