Calculating keypress times

Posted By: gamers

Calculating keypress times - 01/15/23 13:09

Hi Dear 3DGS Developers,

How can I write a code that will start counting the time when I press the "space key" once, and stop counting the time when I press the "space key" once again, and calculate the distance between the time the space key is pressed.
Can you help with this?
Thanks a lot.
Posted By: 3run

Re: Calculating keypress times - 01/16/23 17:14

Hey!

I would use 'on_space' event to toggle the boolean variable from false to true. And then would have an additional function with a loop in it, where the timer would run if boolean is toggled to true and stop (show results, or whatever) when boolean is set to false. Read manual about 'on_' functions that could be assigned to a specific key.

Best regards.
Posted By: gamers

Re: Calculating keypress times - 01/16/23 18:22

Thank you 3run, I'll try this method.
© 2024 lite-C Forums