Gamestudio Links
Zorro Links
Newest Posts
Executing Trades on Next Bar Open
by Zheka. 06/20/24 14:26
Lapsa's very own thread
by rki. 06/19/24 11:27
A simple game ...
by VoroneTZ. 06/18/24 10:50
Face player all the time ...
by bbn1982. 06/18/24 10:25
Zorro Beta 2.61: PyTorch
by jcl. 06/10/24 14:42
New FXCM FIX Plugin
by flink. 06/04/24 07:30
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (AndrewAMD), 692 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
Mino, squik, AemStones, LucasJoshua, Baklazhan
19061 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,210
İstanbul, Turkey
Quad Offline
Senior Expert
Quad  Offline
Senior Expert

Joined: Oct 2007
Posts: 5,210
İ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 | 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