Programming joysticks with linux part 3, Get Ready to Rumble!!!
Sat, Jul 19, 2008.
I’ve added “rumble effect” to Word War vi, the little video game I’ve been working on. My code borrows heavily from Johann Deneux’s fftest.c program which is meant to test the force feedback capabilities of the linux input driver.
Here is my code:
If you want to try to use my code (whcih is GPL’ed), you’d include rumble.h, then call get_ready_to_rumble(NULL); (or pass the filename of your input device, if it isn’t /dev/input/event5). Then call play_rumble_effect(RUMBLE_STRONG_RUMBLE_EFFECT); or the like.
At the end of your program, call close_rumble_fd();
Very simple stuff, but I hope it’s of some help to someone.