You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-24 15:26:15 +00:00
Revert "Fixed event spam when using the Nintendo Switch controller"
This commit is contained in:
@@ -922,10 +922,7 @@ void Input::joy_axis(int p_device, JoyAxis p_axis, const JoyAxisValue &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[(size_t)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[(size_t)p_axis] - p_value.value) < MIN_AXIS_CHANGE) {
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user