Browse Source

Remove the vibration effect from the joystick when stopping

Wilhem Barbier 9 years ago
parent
commit
5d95072879
1 changed files with 3 additions and 5 deletions
  1. 3 5
      platform/x11/joystick_linux.cpp

+ 3 - 5
platform/x11/joystick_linux.cpp

@@ -439,11 +439,9 @@ void joystick_linux::joystick_vibration_stop(int p_id, uint64_t p_timestamp)
 		return;
 		return;
 	}
 	}
 
 
-	struct input_event stop;
-	stop.type = EV_FF;
-	stop.code = joy.ff_effect_id;
-	stop.value = 0;
-	write(joy.fd, (const void*)&stop, sizeof(stop));
+	if (ioctl(joy.fd, EVIOCRMFF, joy.ff_effect_id) < 0) {
+		return;
+	}
 
 
 	joy.ff_effect_id = -1;
 	joy.ff_effect_id = -1;
 	joy.ff_effect_timestamp = p_timestamp;
 	joy.ff_effect_timestamp = p_timestamp;