Commit 11ead627 authored by avi@chromium.org's avatar avi@chromium.org

Add support for Macally iShock.

BUG=140499
TEST=Find iShock, test with http://www.aresluna.org/gamepad-tester/


Review URL: https://chromiumcodereview.appspot.com/10832162

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@150283 0039d316-1c4b-4281-b951-d872f2087c98
parent 6a0464c8
...@@ -93,6 +93,46 @@ void MapperDirectInputStyle( ...@@ -93,6 +93,46 @@ void MapperDirectInputStyle(
mapped->axesLength = kNumAxes; mapped->axesLength = kNumAxes;
} }
void MapperMacallyIShock(
const WebKit::WebGamepad& input,
WebKit::WebGamepad* mapped) {
enum IShockButtons {
kButtonC = kNumButtons,
kButtonD,
kButtonE,
kNumIShockButtons
};
*mapped = input;
mapped->buttons[kButtonPrimary] = input.buttons[6];
mapped->buttons[kButtonSecondary] = input.buttons[5];
mapped->buttons[kButtonTertiary] = input.buttons[7];
mapped->buttons[kButtonQuaternary] = input.buttons[4];
mapped->buttons[kButtonLeftShoulder] = input.buttons[14];
mapped->buttons[kButtonRightShoulder] = input.buttons[12];
mapped->buttons[kButtonLeftTrigger] = input.buttons[15];
mapped->buttons[kButtonRightTrigger] = input.buttons[13];
mapped->buttons[kButtonBackSelect] = input.buttons[9];
mapped->buttons[kButtonStart] = input.buttons[10];
mapped->buttons[kButtonLeftThumbstick] = input.buttons[16];
mapped->buttons[kButtonRightThumbstick] = input.buttons[17];
mapped->buttons[kButtonDpadUp] = input.buttons[0];
mapped->buttons[kButtonDpadDown] = input.buttons[1];
mapped->buttons[kButtonDpadLeft] = input.buttons[2];
mapped->buttons[kButtonDpadRight] = input.buttons[3];
mapped->buttons[kButtonMeta] = input.buttons[11];
mapped->buttons[kButtonC] = input.buttons[8];
mapped->buttons[kButtonD] = input.buttons[18];
mapped->buttons[kButtonE] = input.buttons[19];
mapped->axes[kAxisLeftStickX] = input.axes[0];
mapped->axes[kAxisLeftStickY] = input.axes[1];
mapped->axes[kAxisRightStickX] = -input.axes[5];
mapped->axes[kAxisRightStickY] = input.axes[6];
mapped->buttonsLength = kNumIShockButtons;
mapped->axesLength = kNumAxes;
}
struct MappingData { struct MappingData {
const char* const vendor_id; const char* const vendor_id;
const char* const product_id; const char* const product_id;
...@@ -106,6 +146,7 @@ struct MappingData { ...@@ -106,6 +146,7 @@ struct MappingData {
{ "046d", "c219", MapperDirectInputStyle }, // Logitech F710, D mode { "046d", "c219", MapperDirectInputStyle }, // Logitech F710, D mode
{ "054c", "0268", MapperPlaystationSixAxis }, // Playstation SIXAXIS { "054c", "0268", MapperPlaystationSixAxis }, // Playstation SIXAXIS
{ "2222", "0060", MapperDirectInputStyle }, // Macally iShockX, analog mode { "2222", "0060", MapperDirectInputStyle }, // Macally iShockX, analog mode
{ "2222", "4010", MapperMacallyIShock }, // Macally iShock
}; };
} // namespace } // namespace
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment