- This topic has 11 replies, 2 voices, and was last updated 1 month ago by c4cc.
-
AuthorPosts
-
2024-12-10 at 3:23 am #79294c4ccParticipant2024-12-11 at 5:39 pm #79355c4ccParticipant
2nd attempt, but I have to double press input after first single input to be able to have single input again:
- This reply was modified 1 month, 1 week ago by c4cc.
2024-12-12 at 5:20 am #79357xeonCustomerThere 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.com2024-12-12 at 9:31 am #79363c4ccParticipant2024-12-13 at 3:55 am #79371xeonCustomerWhat 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.com2024-12-13 at 4:09 am #79372xeonCustomerThe 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.com2024-12-13 at 6:35 am #79378c4ccParticipantsadly, even the first input (non-double tapped) is unresponsive
2024-12-13 at 6:55 am #79379xeonCustomerDid 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.com2024-12-13 at 7:29 am #79380c4ccParticipantyes, 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
these initial puzzles actually could have a single input function, if key was tapped once.
- This reply was modified 1 month ago by c4cc.
2024-12-14 at 5:29 am #79389xeonCustomerHere 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.htmlOpen 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.com2024-12-14 at 10:04 am #79394c4ccParticipantThanks for this answer, I’ll get back to you ASAP and let you know.
2024-12-14 at 6:42 pm #79400c4ccParticipantYes, technically, this does work, but I’ll need to make a couple minor tweaks first. Thanks again for this
-
AuthorPosts
- You must be logged in to reply to this topic.