Merge pull request #1166 from CookiePLMonster/xinput-button-fix

XInput: Fix mapping buttons to axes
This commit is contained in:
Connor McLaughlin 2020-12-09 00:22:14 +10:00 committed by GitHub
commit 8e79059fe3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -289,11 +289,10 @@ bool XInputControllerInterface::HandleButtonEvent(u32 index, u32 button, bool pr
return true;
}
// Assume a half-axis, i.e. in 0..1 range
const AxisCallback& axis_cb = m_controllers[index].button_axis_mapping[button];
if (axis_cb)
{
axis_cb(pressed ? 1.0f : 0.0f);
axis_cb(pressed ? 1.0f : -1.0f);
}
return true;
}