IonicWind Software

Creative Basic => GUI Programs => Topic started by: GWS on March 01, 2008, 06:39:14 AM

Title: Joystick DLL
Post by: GWS on March 01, 2008, 06:39:14 AM
Here's a DLL for joystick routines which works in any type of window ...

These are the included routines:

joyx(device)     -  which returns the x-position of the joystick scaled (0 - 1000)
joyy(device)     -  which returns the y-position of the joystick scaled (0 - 1000)
joyz(device)     -  which returns the z-position (throttle) of the joystick scaled (0 - 1000)
joybutton(device)     -  which returns the number of the button pressed

I haven't found a way to get at the joystick 'Twist' value.  I tried using the JoyGetPosEx() API routine but with no success. It uses DWord types and the documentation is a bit confusing.  Maybe someone can get it to work, and then the joystick 'Twist' setting can be accessed.

The attached zip includes the DLL, a test program for a normal window, and one for a DX window, and the code used in EB to create the DLL.

best wishes,  :)

Graham