Programming joysticks with linux part 3, Get Ready to Rumble!!!

Sat, Jul 19, 2008.

See also Part 1, part 2, and some info on getting xbox 360 rumble effect working with linux.

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.

~ by scaryreasoner on July 19, 2008.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: