src/haptic/linux/SDL_syshaptic.c
branchgsoc2008_force_feedback
changeset 2485 67978eea6d10
parent 2484 666472fd4cb0
child 2486 24dd8b8669fa
--- a/src/haptic/linux/SDL_syshaptic.c	Tue Jul 01 14:21:09 2008 +0000
+++ b/src/haptic/linux/SDL_syshaptic.c	Tue Jul 01 14:31:04 2008 +0000
@@ -495,6 +495,27 @@
 
 
 /*
+ * Stops an effect.
+ */
+int
+SDL_SYS_HapticStopEffect(SDL_Haptic * haptic, struct haptic_effect * effect)
+{
+   struct input_event stop;
+
+   stop.type = EV_FF;
+   stop.code = effect->hweffect->effect.id;
+   stop.value = 0;
+
+   if (write(haptic->hwdata->fd, (const void*) &stop, sizeof(stop)) < 0) {
+      SDL_SetError("Unable to stop the haptic effect.");
+      return -1;
+   }
+
+   return 0;
+}
+
+
+/*
  * Frees the effect
  */
 void