mirror of
https://github.com/Relintai/sdl2_frt.git
synced 2024-12-16 11:06:49 +01:00
Worked around an issue where the kernel would lose the force feedback effect
This commit is contained in:
parent
e3cedf967d
commit
c14a59d999
@ -829,7 +829,11 @@ LINUX_JoystickRumble(SDL_Joystick * joystick, Uint16 low_frequency_rumble, Uint1
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (ioctl(joystick->hwdata->fd, EVIOCSFF, &joystick->hwdata->effect) < 0) {
|
if (ioctl(joystick->hwdata->fd, EVIOCSFF, &joystick->hwdata->effect) < 0) {
|
||||||
return SDL_SetError("Couldn't update rumble effect: %s", strerror(errno));
|
/* The kernel may have lost this effect, try to allocate a new one */
|
||||||
|
joystick->hwdata->effect.id = -1;
|
||||||
|
if (ioctl(joystick->hwdata->fd, EVIOCSFF, &joystick->hwdata->effect) < 0) {
|
||||||
|
return SDL_SetError("Couldn't update rumble effect: %s", strerror(errno));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
event.type = EV_FF;
|
event.type = EV_FF;
|
||||||
|
Loading…
Reference in New Issue
Block a user