File Exchange

image thumbnail

Force Feedback Joystick

version (33.8 KB) by Anas Fattouh
Reading XY-positions and applying constant forces for a USB force feedback joystick.


Updated 18 Mar 2004

No License

This is the first version of a MEX-file that enables you reading XY-positions of a USB force feedback joystick and applying constant forces on it.

It was created using Direct Input in DirectX 8.1 and Microsoft Visual C++ 6.0. I tested it on Microsoft SideWinder Force Feedback 2 joystick using MATLAB R13 and MS Windows XP.

Cite As

Anas Fattouh (2021). Force Feedback Joystick (, MATLAB Central File Exchange. Retrieved .

Comments and Ratings (11)


I tried to use this dll file in Simulink, but it causes the crash of Matlab. Maybe the dll file is not compatible with windows 7 ?
Does anyone have an idea of the issue ?



I have used the Force Feedback Joystick file for logging and powering a Thrustmaster T500 RS steering wheel in Matlab Simulink. This works very well. I would, however, like to make some small changes to the s-function, as the functionality of the steering wheel can be improved if some changes are applied. Does anyone have the s-function to change this?


the simulink-model work perfectly with my force 3D pro joystick, thanks for that!

does anyone know how i can get information about buttons pressed on the joystick into matlab/simulink?

any help would be appreciated!


Marc Turcotte


I am working on a project and I need to read the force feedback infos of the steering wheel ( logitech momo force). More precisely, I want to monitor the force feedback effect to determine when the feedback is increased and decreased.

Anyone knows a way to get this done?



Abhishek Ramkumar

Hi Anas,

Great work on the force feedback control!

I am currently trying to make a .dll file using Microsoft Visual C++ and DirectX to control the force feedback to my "Logitech force 3D USB Pro" joystick. I want to access/control the functions via National Instruments' Labview and have the force feedback effect.

I have gone through the examples (FFconst_2008.proj) and am able to make an Win Application (.exe) but am finding it difficult to make a .dll.

Could you give me some hints or a sample VC++ program to create a .dll to control force feedback? Any help in this regard would be much appreciated.

Thanks in advance!

Sippapas Sirijatuphat

It is excellent used in Simulink. But how can it be used to M-files? How can it read data from joystick and send force feedback to joystick? it I want to use joystick with XPC, and what should I do? How much for it?

Longjiang Zhou

It is excellent used in Simulink. But how can it be used to M-files? e.g. read data from joystick and send force feedback to joystick?

chen yongliang

Tim Barfoot

Worked right out of the box with DirectX9.0 and Matlab 7.0 R13 and a Logitech Wingman Rumblepad.

Brent S

Excellent use of force feedback within Simulink!

MATLAB Release Compatibility
Created with R13
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!