Page 2 of 2 FirstFirst 1 2
Results 16 to 19 of 19

Thread: NLDJoystick

  1. #16
    Quote Originally Posted by NGLN View Post
    The Buttons parameter from the OnButtonDown and OnButtonUp events reflect the current state of the buttons. Thus, the parameter in OnButtonUp being 1 less than in OnButtonDown is by design. Maybe I will change this in future, but the present implementation says that á button is released, not which. For now I recommend to save the previous button state in a private field and compare.

    The typical use I had in mind with this component was:

    Delphi Code:
    1. procedure TForm1.NLDJoystick1ButtonDown(Sender: TNLDJoystick;
    2.   const Buttons: TJoyButtons);
    3. begin
    4.   if JoyBtn12 in Buttons then
    5.     IsFiring := True;
    6. end;
    7.  
    8. procedure TForm1.NLDJoystick1ButtonUp(Sender: TNLDJoystick;
    9.   const Buttons: TJoyButtons);
    10. begin
    11.   if not (JoyBtn12 in Buttons) then
    12.     IsFiring := False;
    13. end;
    This is what i do ....
    I create an array of buttondown actions [0..31] and when a button down
    the ButtonsDown[i] take the number 1 if free check if the if the number 1 still exist...

    But i have a problem with the two simultaneously press buttons...

    Can i somehow have the joybtn1 isdown = true... so i dont need to create array to hold the state...?

    Thank you for you help...

    P.S.. OK i fix it...
    The fix is my stupid check again the array and clear the first so only on button is on...

    Thanks for your great component...
    Last edited by azrael11; 23-Jan-13 at 11:36.

  2. #17
    Hello again...

    Everthing seems to work ok...
    Except with the controllers the have xinput only drivers ...
    Like XBOX 360 gamepad for PC

    I get only the left and right directions...
    If you can help me that's very usefull for me...
    And one more question ... who can i set the deadzone of the joystick...

    Thank you very much...

  3. #18
    Silly member NGLN's Avatar
    Join Date
    Aug 2004
    Location
    Werkendam
    Posts
    5,133
    (Sender as TNLDUser).Signature := 'Groeten van Albert';

  4. #19
    How can I download this component?
    What is the User and Password for:
    http://svn.nldelphi.com/nldelphi/ope...n/NLDJoystick/

Page 2 of 2 FirstFirst 1 2

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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