May 08, 2024, 12:38:07 PM

News:

IonicWind Snippit Manager 2.xx Released!  Install it on a memory stick and take it with you!  With or without IWBasic!


Joystick DLL

Started by GWS, March 01, 2008, 06:39:14 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

GWS

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
Tomorrow may be too late ..