JoyMex JoyMex
Code and binaries distributed under the BSD License
JoyMEX is a MEX-file which allows querying (multiple) Gamepad devices from MATLAB in Microsoft Windows.

Included in the download is:
  • Pre-built binary for MATLAB R2009b (both 32-bit and 64-bit version).
  • Example JoyTest.m which shows the usage of JoyMEX.
  • C++ Source plus Visual Studio 2008 project for building yourself.

Note: JoyMEX uses Microsoft DirectInput to communicate to the devices, therefore Microsoft DirectX needs to be installed on your system to be able to use JoyMEX.

Before a device can be queried it must be initialized by calling:
Where deviceid is the device number (0-3). If you need to access more devices you should initialize them in separate calls. After the initialization the MEX-file will typically be called in a loop. MATLAB\JoyTest.m shows an example of this.

When done with the devices they should be release by calling:
clear JoyMEX
For more information type:
help JoyMEX
MATLAB Valid XHTML 1.0 Strict Valid CSS!