Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
0 registered members (), 18,495 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Text Editor - problem #288492
09/06/09 20:56
09/06/09 20:56
Joined: Apr 2009
Posts: 141
dakilla Offline OP
Member
dakilla  Offline OP
Member

Joined: Apr 2009
Posts: 141
I am currently making a very simple text editor that opens a file with a set name (txt), and writes what button you press onto it. so far it is going fine but i hit a problem, when i press a key it writes it loads of times onto the file. i found out the problem, that is that i need to somehow use:
"if(key_a_released){do this}"
is there any way of doing this?


One day there will be an unfixable bug,
That day is not today.
Re: Fire Key Input Only Once [Re: dakilla] #288497
09/06/09 21:25
09/06/09 21:25
Joined: Apr 2009
Posts: 27
Silicon Valley
D
Dillinger Offline
Newbie
Dillinger  Offline
Newbie
D

Joined: Apr 2009
Posts: 27
Silicon Valley
Sure, no problemo.

Use on_key to call a function:

Code:
function my_Function()
{
   // do this only one time
}

on_a = my_Function ;



Re: Text Editor - problem [Re: dakilla] #288498
09/06/09 21:25
09/06/09 21:25
Joined: Oct 2007
Posts: 5,211
İstanbul, Turkey
Quad Offline
Senior Expert
Quad  Offline
Senior Expert

Joined: Oct 2007
Posts: 5,211
İstanbul, Turkey
while(key_a)wait(1);//wait until a is released
do this.


3333333333
Re: Text Editor - problem [Re: Quad] #288500
09/06/09 21:34
09/06/09 21:34
Joined: Apr 2009
Posts: 141
dakilla Offline OP
Member
dakilla  Offline OP
Member

Joined: Apr 2009
Posts: 141
hmph, none of those work...

Dillinger - i need it so that to does something when a key is released, not pressed, but ty neways.

Quadraxas - that helped alot :), i changed it a bit:
if(key_a){while(key_a){wait_1}do this};
a bit confusing, but does the job.
Thanks.


One day there will be an unfixable bug,
That day is not today.

Gamestudio download | 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