Merge pull request #56028 from madmiraal/revert-55978-fix-switch-controller-event-spam

This commit is contained in:
Rémi Verschelde 2021-12-21 09:44:59 +01:00 committed by GitHub
commit 5ffee633cd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -922,10 +922,7 @@ void Input::joy_axis(int p_device, JoyAxis p_axis, const JoyAxisValue &p_value)
Joypad &joy = joy_names[p_device];
// Make sure that we don't generate events for up to 5% jitter
// This is needed for Nintendo Switch Pro controllers, which jitter at rest
const float MIN_AXIS_CHANGE = 0.05f;
if (fabs(joy.last_axis[(size_t)p_axis] - p_value.value) < MIN_AXIS_CHANGE) {
if (joy.last_axis[(size_t)p_axis] == p_value.value) {
return;
}