Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 27

Thread: TBDI - DirectInput Joystick module

  1. #11

    Re: TBDI - DirectInput Joystick module

    Can you switch the pad into DIGITAL mode? So use the 8 directional pad instead of the analog stick?

  2. #12
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    57
    Posts
    8,777
    Rep Power
    10

    Re: TBDI - DirectInput Joystick module

    OK, definitely a gamepad config.
    Always + or - values between 20/45 on both axis.
    I will try to find another gamepad. Better, I will buy a new one in next days.

    To solve my problem I will change to
    [code=thinbasic]if GetAsyncKeyState(%VK_UP) or joyY < -40 then
    if GetAsyncKeyState(%VK_DOWN) or joyY > 40 then
    '....
    '....[/code]

    Mike, THANKS FOR THE BIG PRESENT !
    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

  3. #13

    Re: TBDI - DirectInput Joystick module

    Thank you too! It's great to see thinBasic envolve and be a part of it. It is another little step to complete thinBasic gaming abilities.

    I will head to bed now, see you tommorow.

  4. #14
    thinBasic MVPs kryton9's Avatar
    Join Date
    Nov 2006
    Location
    Naples, Florida & Duluth, Georgia
    Age
    67
    Posts
    3,869
    Rep Power
    404

    Re: TBDI - DirectInput Joystick module

    Wow lay down to take a nap and the game input device module is HERE, woo hoo. Thanks Mike!!
    Thanks Eros for putting into a game file to play with.

    Very happy to report works very well with my Logitech Extreme 3D joystick.

    Mike, is there a routine that checks for the number of buttons on joysticks and gamepads?
    I just used directx input functions before in programming and it seemed to handle everything well.

    Mayb I ask what library you are using for input handling?
    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

  5. #15

    Re: TBDI - DirectInput Joystick module

    I'm glad you found this a nice wake up surprise.

    No, right now there are only these 5 little functions but I will add the suggested ones of course, if my coding abilities will let me do it.

    I'm using PowerBasic to develop this module. With it I interface DirectInput from the MS DirectX SDK. I found some translated include files a basic example in the net.

    The hard part was trying to get the joysticks report values between -1024 to 1024 bey default and not just raw data for the axxis from 0 to 65335. This was because the example I used was faulty plus the include files were also a little buggy. They used the wrong data types in some places.

    So next step will be these little functions you mentioned plus functions to read all joysticks on a pad, sliders, POV. After this I will attack effects so you can have your pad rumbeling when your ship got hit. At the end I would like to able to support 2 joysticks at the same time, but I don't know right now how to do it.

  6. #16
    thinBasic MVPs kryton9's Avatar
    Join Date
    Nov 2006
    Location
    Naples, Florida & Duluth, Georgia
    Age
    67
    Posts
    3,869
    Rep Power
    404

    Re: TBDI - DirectInput Joystick module

    It is definitly a great start and glad you will add all the support you can to it. I guess since thinBasic will always be on Windows Operating Systems going with DirectX is not an issue. I didn't know you could use part of an SDK for making your own dll modules. That is great to know.

    I got another question for you, why were you concerned about dealing with 0 to 65335 as a range compared to the now -1024 to 1024, just curious?
    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

  7. #17

    Re: TBDI - DirectInput Joystick module

    I found it more usefull, then saying the middle is 37thousandsomething. Plus I needed this functionality anyway to be able to control the deadzone of a joystick. You will get a function where you can set the range yourself.

    The other solution for Joystick would be using the SDL lib, but then we would have to ship allways another dll with it. Plus effects are not available on it I think.

  8. #18
    thinBasic MVPs kryton9's Avatar
    Join Date
    Nov 2006
    Location
    Naples, Florida & Duluth, Georgia
    Age
    67
    Posts
    3,869
    Rep Power
    404

    Re: TBDI - DirectInput Joystick module

    I see Mike, thanks. MY course that I ordered will show SDL, but I am not even to getting there yet to see what all it can do. They just mentioned it was great for making games. I will know more in a few months I guess once I make my way through.
    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

  9. #19

    Re: TBDI - DirectInput Joystick module

    Last night I implemented allmost everything that I wanted. Onlyforce feedback is missing now. One problem I have is what Eros suggested, calling Init and Close from the attach and detach processes. thinbasic hangs up without any complain/message, etc. First I want to check it again before I call Eros for help. After I did more documentation and write a sample script, I will release this version.

  10. #20

    Re: TBDI - DirectInput Joystick module

    Ok, I know where it hangs up now. In any example and the sdk docu, you have to acquiere the joystick before you use it. So I do that within the TBDI_Init function. It works. When I call this function from the DLL's attach process, it hangs at this part. The funny part is that when I don't acquiere the joystick, the joystick still works. Go figure ???

    As I don't know if leaving it out will have bad sideeffects, I will stay with the external version of TBDI_Init and TBDI_Close for now. I think two extra commands won't make it that bad. When I have everything inside the module, I will give Eros the sources and let him have a try. Maybe I'm doing something wrong with the DLL's attach process. Regarding to TBDI_Close, when I put that inside the DETACH process of the DLL, it doesn't get called. Mmmh, maybe a bug inside thinbasic.

    Tommorow night (my time) I will release this version. Tonight I find no time as we have friends over for dinner.

Page 2 of 3 FirstFirst 123 LastLast

Similar Threads

  1. So how do you get along with the TBDI module?
    By Michael Hartlef in forum TBDI module. thinBasic Direct Input integration by MikeHart
    Replies: 36
    Last Post: 30-08-2007, 09:07

Members who have read this thread: 3

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •