Gamestudio Links
Zorro Links
Newest Posts
separating groups of 3 digits by a comma
by joe_kane. 01/11/26 00:01
MRC.c and WFO
by joe_kane. 01/10/26 23:58
BarOffset (default = 940 for daily bars?
by joe_kane. 01/10/26 23:46
NOMAX undeclared identifier.
by Petra. 01/09/26 21:12
Sam Foster Sound | Experienced Game Composer for Hire
by titanicpiano14. 01/07/26 15:14
Zorro locks DLL
by jcl. 01/07/26 13:33
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
1 registered members (joe_kane), 6,009 guests, and 14 spiders.
Key: Admin, Global Mod, Mod
Newest Members
joe_kane, Namitha_NN, Syndrela, agasior, mosfet
19189 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