Gamestudio Links
Zorro Links
Newest Posts
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (Ayumi), 662 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 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