src/haptic/linux/SDL_syshaptic.c
branchgsoc2008_force_feedback
changeset 2485 67978eea6d10
parent 2484 666472fd4cb0
child 2486 24dd8b8669fa
     1.1 --- a/src/haptic/linux/SDL_syshaptic.c	Tue Jul 01 14:21:09 2008 +0000
     1.2 +++ b/src/haptic/linux/SDL_syshaptic.c	Tue Jul 01 14:31:04 2008 +0000
     1.3 @@ -495,6 +495,27 @@
     1.4  
     1.5  
     1.6  /*
     1.7 + * Stops an effect.
     1.8 + */
     1.9 +int
    1.10 +SDL_SYS_HapticStopEffect(SDL_Haptic * haptic, struct haptic_effect * effect)
    1.11 +{
    1.12 +   struct input_event stop;
    1.13 +
    1.14 +   stop.type = EV_FF;
    1.15 +   stop.code = effect->hweffect->effect.id;
    1.16 +   stop.value = 0;
    1.17 +
    1.18 +   if (write(haptic->hwdata->fd, (const void*) &stop, sizeof(stop)) < 0) {
    1.19 +      SDL_SetError("Unable to stop the haptic effect.");
    1.20 +      return -1;
    1.21 +   }
    1.22 +
    1.23 +   return 0;
    1.24 +}
    1.25 +
    1.26 +
    1.27 +/*
    1.28   * Frees the effect
    1.29   */
    1.30  void