Merge pull request #56029 from madmiraal/revert-55997-3.x-fix-switch-controller-event-spam
This commit is contained in:
commit
9bc750da55
1 changed files with 1 additions and 4 deletions
|
@ -811,10 +811,7 @@ void InputDefault::joy_axis(int p_device, int p_axis, const JoyAxis &p_value) {
|
||||||
|
|
||||||
Joypad &joy = joy_names[p_device];
|
Joypad &joy = joy_names[p_device];
|
||||||
|
|
||||||
// Make sure that we don't generate events for up to 5% jitter
|
if (joy.last_axis[p_axis] == p_value.value) {
|
||||||
// This is needed for Nintendo Switch Pro controllers, which jitter at rest
|
|
||||||
const float MIN_AXIS_CHANGE = 0.05f;
|
|
||||||
if (fabs(joy.last_axis[p_axis] - p_value.value) < MIN_AXIS_CHANGE) {
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue