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
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:
[code=thinbasic]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
[/code]
Suggestions, critics and other things are allways welcome.
Cheers
Michael
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
Learn 3D graphics with ThinBASIC, learn TBGL!
Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB
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.
Acer Notebook: Win 10 Home 64 Bit, Core i7-4702MQ @ 2.2Ghz, 12 GB RAM, nVidia GTX 760M and Intel HD 4600
Raspberry Pi 3: Raspbian OS use for Home Samba Server and Test HTTP Server
Yip, Kent said it. But I couldn't test it so far, so I don't know how it reacts.
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:
[code=thinbasic]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[/code]
Ciao
Eros
www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000
Do, I should have taken that out. I will remove it. Thanks for spotting it.
Help almost finished.
Module and help material will be present in next preview release.
www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000
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
Bookmarks