浏览代码

Revert "[3.x] Fixed event spam when using the Nintendo Switch controller"

(cherry picked from commit 9f250e837073b2914ec4920ab0012bdf170e7dfc)
Marcel Admiraal 3 年之前
父节点
当前提交
fbf32c1ea2
共有 1 个文件被更改,包括 1 次插入4 次删除
  1. 1 4
      main/input_default.cpp

+ 1 - 4
main/input_default.cpp

@@ -811,10 +811,7 @@ void InputDefault::joy_axis(int p_device, int p_axis, const JoyAxis &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[p_axis] - p_value.value) < MIN_AXIS_CHANGE) {
+	if (joy.last_axis[p_axis] == p_value.value) {
 		return;
 	}