We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.

Double tapping key input spams more than a 2nd input?

Home Forums Puzzles Double tapping key input spams more than a 2nd input?

  • This topic has 11 replies, 2 voices, and was last updated 1 month ago by c4cc.
Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #79294
    c4cc
    Participant

    I just want the double input key to play only a 2nd animation, not spam it when pressed repeatedly. How do I prevent that spamming?

    My puzzles and Blend file are attached

    olx1

    #79355
    c4cc
    Participant

    2nd attempt, but I have to double press input after first single input to be able to have single input again:

    olx1

    • This reply was modified 1 month, 1 week ago by c4cc.
    #79357
    xeon
    Customer

    There are many approaches to a managing a double tap. This is one approach.
    Regardless of your approach, I would recommend moving the the logic out of the keydown event and into a procedure that you can then test if the keydown is a single or double or if the double tap action is already in process. You will also need to decide if the double tap action can be interrupted or restarted if a second double click occurs before the initial double tap action/animation is completed or are repeated double click requests ignored until the current double click action/animation is completed.

    The following is based on the double click and will ignore other double clicks until the initial animation is completed…then it resets for the next double tap.

    Attachments:
    You must be logged in to view attached files.

    Xeon
    Route 66 Digital
    Interactive Solutions - https://www.r66d.com
    Tutorials - https://www.xeons3dlab.com

    #79363
    c4cc
    Participant

    I tried, sadly not working

    olx1

    #79371
    xeon
    Customer

    What is your FPS?

    If it’s 60… 5 frames divide by 60 (FPS) is .08 seconds to play the first animation the you ask it to wait .1 so you are at .18 seconds… add another 5 frame animation and now you are at .26 seconds or more which exceeds the double click timer of .2 seconds.

    Try increasing the double tap timer to .3

    Xeon
    Route 66 Digital
    Interactive Solutions - https://www.r66d.com
    Tutorials - https://www.xeons3dlab.com

    #79372
    xeon
    Customer

    The play animation puzzle is fairly slow to reset back to frame 54 when called again so in your resetkickdoubletap procedure you should force you animation frames back to frame 54 so they are ready for the next double tap

    Xeon
    Route 66 Digital
    Interactive Solutions - https://www.r66d.com
    Tutorials - https://www.xeons3dlab.com

    #79378
    c4cc
    Participant

    sadly, even the first input (non-double tapped) is unresponsive

    #79379
    xeon
    Customer

    Did you test the source project to ensure it provides the functionality you need?

    Xeon
    Route 66 Digital
    Interactive Solutions - https://www.r66d.com
    Tutorials - https://www.xeons3dlab.com

    #79380
    c4cc
    Participant

    yes, I did.

    I just want the double input key to play only a 2nd animation, not spam it when pressed repeatedly. How do I prevent that spamming?

    My puzzles and Blend file are attached

    olx1

    these initial puzzles actually could have a single input function, if key was tapped once.

    • This reply was modified 1 month ago by c4cc.
    #79389
    xeon
    Customer

    Here is another working sample with the 5 key.
    Single tap makes the cone rotate.
    Double tap will make it jump while rotating.

    Project file located here with blend file: https://v3d.net/16e9
    Demo located here: http://localhost:8668/applications/X3L_double_tap_key/X3L_double_tap_key.html

    Open the demo in developer mode and monitor the console log so you can see when events fire.

    Try out the puzzles with a simple animation similar to what I have provided. Validate its working the way you want…Then switch the animation so something more complicated.
    If it fails with your animation then you have to determine why….is the animation you are playing consuming too much memory…fps low… whats causing it to not fire properly.

    Xeon
    Route 66 Digital
    Interactive Solutions - https://www.r66d.com
    Tutorials - https://www.xeons3dlab.com

    #79394
    c4cc
    Participant

    Thanks for this answer, I’ll get back to you ASAP and let you know.

    #79400
    c4cc
    Participant

    Yes, technically, this does work, but I’ll need to make a couple minor tweaks first. Thanks again for this

Viewing 12 posts - 1 through 12 (of 12 total)
  • You must be logged in to reply to this topic.