Gamestudio Links
Zorro Links
Newest Posts
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
Trading Journey
by 7th_zorro. 04/27/24 04:42
Help with plotting multiple ZigZag
by M_D. 04/26/24 20:03
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
M1 Oversampling
by jcl. 04/26/24 11:12
Why Zorro supports up to 72 cores?
by jcl. 04/26/24 11:09
Eigenwerbung
by jcl. 04/26/24 11:08
MT5 bridge not working on MT5 v. 5 build 4160
by EternallyCurious. 04/25/24 20:49
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (TipmyPip, Ayumi), 773 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
wandaluciaia, Mega_Rod, EternallyCurious, howardR, 11honza11
19049 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Calculating keypress times #487091
01/15/23 13:09
01/15/23 13:09
Joined: Jan 2012
Posts: 108
G
gamers Offline OP
Member
gamers  Offline OP
Member
G

Joined: Jan 2012
Posts: 108
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.

Re: Calculating keypress times [Re: gamers] #487101
01/16/23 17:14
01/16/23 17:14
Joined: May 2009
Posts: 5,370
Caucasus
3run Offline
Senior Expert
3run  Offline
Senior Expert

Joined: May 2009
Posts: 5,370
Caucasus
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.


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Re: Calculating keypress times [Re: 3run] #487102
01/16/23 18:22
01/16/23 18:22
Joined: Jan 2012
Posts: 108
G
gamers Offline OP
Member
gamers  Offline OP
Member
G

Joined: Jan 2012
Posts: 108
Thank you 3run, I'll try this method.


Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1