Gamestudio Links
Zorro Links
Newest Posts
ZorroGPT
by TipmyPip. 08/22/26 08:44
Max Number of Strategies in /Strategy folder
by Martin_HH. 08/17/26 07:54
Pause button for evaluation shell?
by AndrewAMD. 08/13/26 17:16
Sam Foster Sound | Experienced Game Composer for Hire
by titanicpiano14. 08/10/26 12:46
phantom() not defined in indicators.c
by jcl. 08/07/26 11:45
Accepting new programming clients
by AndrewAMD. 08/06/26 21:25
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
0 registered members (), 2,494 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
riggi89, shuhari, KD1990, Student_64151, Koti
19230 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