PDA

View Full Version : TBDI module Alpha 2



Michael Hartlef
03-03-2007, 21:39
Hi folks,

friends are gone and I had some more time with the DirectInput module.
Say goodbye to 2 functions (TBDI_INIT and TBDI_CLOSE)!
Say hello to 18 new functions to make your life regarding joysticks easier.

Here is the current command set:


n = TBDI_JoyButton ( buttonnumber AS LONG) 'Check if a button is pressed
n = TBDI_JoyX 'Retrieve the X-Axxis (default= -1024 to 1024)
n = TBDI_JoyY 'Retrieve the Y-Axxis (default= -1024 to 1024)
n = TBDI_JoyZ 'Retrieve the Z-Axxis (default= -1024 to 1024)

n = TBDI_JoyRX 'Retrieve the rotation X-Axxis (default= -1024 to 1024)
n = TBDI_JoyRY 'Retrieve the rotation Y-Axxis (default= -1024 to 1024)
n = TBDI_JoyrZ 'Retrieve the rotation Z-Axxis (default= -1024 to 1024)

n = TBDI_JoyAvail 'Returns %TRUE if Joystick is available.
n = TBDI_JoyCountBtn 'Returns the amount of buttons available
n = TBDI_JoyCountAxes 'Returns the amount of axxis available
n = TBDI_JoyCountPOV 'Returns the amount of POV switches available

n = TBDI_JoyPOV( POVnumber as LONG) 'Retrieve the POV data in degree*100, POVNUMBER starts with 1
n = TBDI_JoySlider( slidernumber as LONG) 'Retrieve slider data

TBDI_JoySetRangeXYZ(min as LONG, max as LONG) 'Sets the range for all axxis
TBDI_JoySetRangeX(min as LONG, max as LONG) 'Sets the range for X-axxis
TBDI_JoySetRangeY(min as LONG, max as LONG) 'Sets the range for Y-axxis
TBDI_JoySetRangeZ(min as LONG, max as LONG) 'Sets the range for Z-axxis

TBDI_JoySetDeadZoneXYZ(percent as LONG) 'Sets the deadzone for all axxis
TBDI_JoySetDeadZoneX(percent as LONG) 'Sets the deadzone for X-axxis
TBDI_JoySetDeadZoneY(percent as LONG) 'Sets the deadzone for Y-axxis
TBDI_JoySetDeadZoneZ(percent as LONG) 'Sets the deadzone for Z-axxis


Suggestions, critics and other things are allways welcome.

Cheers
Michael

Petr Schreiber
03-03-2007, 22:00
Now this is something !

Really all I could imagine for joystick handling, perfect...
Just one question - what is slider :-X

Thanks a lot Mike,
Petr

kryton9
03-03-2007, 22:29
Mike, first wonderful list of commands. Thanks so much. Will give us lots to play with in the coming months!

Petr, the slider is used as a throttle control on most joysticks and it looks like and is a slider on most joysticks. In some cases, a one axis rotation finger control is used as in my Logitech Extreme 3DPro joystick.

Michael Hartlef
03-03-2007, 22:54
Yip, Kent said it. But I couldn't test it so far, so I don't know how it reacts.

ErosOlmi
04-03-2007, 00:15
Mike,

thanks a lot for this new version. A lot of new functions. They will give a new immersions in next games. I think all next version games will have to manage keyboards, joystick and possibly mouse. But it will depend on game.

Few little problems.

If no joystick is present a messagebox appear. I think you have used standard MSGBOX from Power Basic. Problem is that it reports "PowerBasic" in caption.
I think no messagebox should appear but a user function should be developed giving the user the option to check if a gamepad is present or not.

Created forum keywords for automatic syntax highlight. Some keywords are not highlighted in above post because keywords found in module have different names. For example in module I've found "TBDI_JOYSLIDER" and not "TBDI_SLIDER". It seems the word "JOY" is missing in some keywords.

Keywords found in TBDI module are the following:

TBDI_JOYAVAIL
TBDI_JOYBUTTON
TBDI_JOYCOUNTAXES
TBDI_JOYCOUNTBTN
TBDI_JOYCOUNTPOV
TBDI_JOYPOV
TBDI_JOYRX
TBDI_JOYRY
TBDI_JOYRZ
TBDI_JOYSETDEADZONEX
TBDI_JOYSETDEADZONEXYZ
TBDI_JOYSETDEADZONEY
TBDI_JOYSETDEADZONEZ
TBDI_JOYSETRANGEX
TBDI_JOYSETRANGEXYZ
TBDI_JOYSETRANGEY
TBDI_JOYSETRANGEZ
TBDI_JOYSLIDER
TBDI_JOYX
TBDI_JOYY
TBDI_JOYZ

Ciao
Eros

Michael Hartlef
04-03-2007, 09:47
Do, I should have taken that out. I will remove it. Thanks for spotting it.

ErosOlmi
04-03-2007, 10:05
Help almost finished.
Module and help material will be present in next preview release.

Michael Hartlef
04-03-2007, 10:18
Hi Eros,

please download again, I took the msgbox out. I forgot to change the commands inside the textfile, but for the helpfile you will use the correct ones, right? :)
Thanks for the effort.

Michael