summaryrefslogtreecommitdiff
path: root/platform/x11
diff options
context:
space:
mode:
authorWilhem Barbier <nounoursheureux@openmailbox.org>2016-06-20 11:01:07 +0200
committerWilhem Barbier <nounoursheureux@openmailbox.org>2016-06-20 11:01:07 +0200
commit5d950728795cdc9cc6ea3c40e29b38d3dc43b709 (patch)
tree0365d28314ca230c283f5d630f8e5584c29dcfa2 /platform/x11
parent913e3206dbbc503fcdf093f8ac52a06cd6641103 (diff)
Remove the vibration effect from the joystick when stopping
Diffstat (limited to 'platform/x11')
-rw-r--r--platform/x11/joystick_linux.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/platform/x11/joystick_linux.cpp b/platform/x11/joystick_linux.cpp
index 5ce0219df7..82f79c2640 100644
--- a/platform/x11/joystick_linux.cpp
+++ b/platform/x11/joystick_linux.cpp
@@ -439,11 +439,9 @@ void joystick_linux::joystick_vibration_stop(int p_id, uint64_t p_timestamp)
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_timestamp = p_timestamp;