Skip to content
Permalink
Browse files
Merge pull request #6224 from hackbar/input-fix-moga
Android: Handle missing mappings for the Moga Pro 2 HID controller.
  • Loading branch information
degasus committed Dec 19, 2017
2 parents ed13a8d + 0067bf1 commit f547703
Showing 1 changed file with 14 additions and 0 deletions.
@@ -45,6 +45,14 @@ else if (isXboxOneWireless(inputDevice))
return 0.0f;
}
}
else if (isMogaPro2Hid(inputDevice))
{
// This controller has a broken axis that reports a constant value. Ignore it.
if (axis == MotionEvent.AXIS_GENERIC_1)
{
return 0.0f;
}
}
return value;
}

@@ -59,4 +67,10 @@ private boolean isXboxOneWireless(InputDevice inputDevice)
// Microsoft Xbox One controller
return inputDevice.getVendorId() == 0x45e && inputDevice.getProductId() == 0x2e0;
}

private boolean isMogaPro2Hid(InputDevice inputDevice)
{
// Moga Pro 2 HID
return inputDevice.getVendorId() == 0x20d6 && inputDevice.getProductId() == 0x6271;
}
}

0 comments on commit f547703

Please sign in to comment.