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

Unified Diff: device/gamepad/gamepad_standard_mappings_linux.cc

Issue 2468143002: Add Gamepad mapping for Samsung EI-GP20 (Closed)
Patch Set: Rebase patch Created 3 years, 10 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: 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 b4de59fc05aac144a01de1f7ce4f3276c42435d6..38367685c4716a0d3b21a82bb52d7b03fc85a1d6 100644
--- a/device/gamepad/gamepad_standard_mappings_linux.cc
+++ b/device/gamepad/gamepad_standard_mappings_linux.cc
@@ -317,6 +317,38 @@ void MapperMogaPro(const blink::WebGamepad& input, blink::WebGamepad* mapped) {
mapped->axesLength = AXIS_INDEX_COUNT;
}
+void MapperSamsung_EI_GP20(const blink::WebGamepad& input,
+ blink::WebGamepad* 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[3];
+ mapped->buttons[BUTTON_INDEX_QUATERNARY] = input.buttons[4];
+ mapped->buttons[BUTTON_INDEX_LEFT_SHOULDER] = NullButton();
+ mapped->buttons[BUTTON_INDEX_RIGHT_SHOULDER] = NullButton();
+ mapped->buttons[BUTTON_INDEX_LEFT_TRIGGER] = input.buttons[6];
+ mapped->buttons[BUTTON_INDEX_RIGHT_TRIGGER] = input.buttons[7];
+ mapped->buttons[BUTTON_INDEX_BACK_SELECT] = input.buttons[10];
+ mapped->buttons[BUTTON_INDEX_START] = input.buttons[11];
+ mapped->buttons[BUTTON_INDEX_LEFT_THUMBSTICK] = NullButton();
+ mapped->buttons[BUTTON_INDEX_RIGHT_THUMBSTICK] = NullButton();
+
+ mapped->buttons[BUTTON_INDEX_DPAD_UP] = AxisNegativeAsButton(input.axes[5]);
+ mapped->buttons[BUTTON_INDEX_DPAD_DOWN] = AxisPositiveAsButton(input.axes[5]);
+ mapped->buttons[BUTTON_INDEX_DPAD_LEFT] = AxisNegativeAsButton(input.axes[4]);
+ mapped->buttons[BUTTON_INDEX_DPAD_RIGHT] =
+ AxisPositiveAsButton(input.axes[4]);
+ mapped->buttons[BUTTON_INDEX_META] = input.buttons[15];
+
+ mapped->axes[AXIS_INDEX_LEFT_STICK_X] = input.axes[0];
+ mapped->axes[AXIS_INDEX_LEFT_STICK_Y] = input.axes[1];
+ mapped->axes[AXIS_INDEX_RIGHT_STICK_X] = input.axes[2];
+ mapped->axes[AXIS_INDEX_RIGHT_STICK_Y] = input.axes[3];
+
+ mapped->buttonsLength = BUTTON_INDEX_COUNT;
+ mapped->axesLength = AXIS_INDEX_COUNT;
+}
+
struct MappingData {
const char* const vendor_id;
const char* const product_id;
@@ -335,6 +367,7 @@ struct MappingData {
{"046d", "c21d", MapperXInputStyleGamepad}, // Logitech F310
{"046d", "c21e", MapperXInputStyleGamepad}, // Logitech F510
{"046d", "c21f", MapperXInputStyleGamepad}, // Logitech F710
+ {"04e8", "a000", MapperSamsung_EI_GP20}, // Samsung Gamepad EI-GP20
{"054c", "0268", MapperPlaystationSixAxis}, // Playstation SIXAXIS
{"054c", "05c4", MapperDualshock4}, // Playstation Dualshock 4
{"054c", "09cc", MapperDualshock4}, // Dualshock 4 (PS4 Slim)
« no previous file with comments | « AUTHORS ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698