
-----------------------------------
lordroba
Sat Oct 14, 2006 7:18 pm

any key pressed
-----------------------------------
(sorry, for the newb question but I am really lazy right now)

Can somebody give me the syntax to detect if a key was pressed.  To be used like the example below(with proper syntax of course).  I need the part with the '*'


If condition.... then
   blah 
   blah
   *Wait for a any key to be pressed, then continue
   blah
   blah
end if

-----------------------------------
Tony
Sat Oct 14, 2006 7:48 pm


-----------------------------------
the [Turing Walkthrough] -> Input.KeyDown

-----------------------------------
TokenHerbz
Sat Oct 14, 2006 11:01 pm


-----------------------------------

Input.Pause


-----------------------------------
lordroba
Sun Oct 15, 2006 5:40 pm


-----------------------------------
Actually I found that 

var ch : string (1)
getch (ch)


got the job done better.  Thanks for the help guys  :D

-----------------------------------
[Gandalf]
Sun Oct 15, 2006 5:43 pm


-----------------------------------
Why would you say that?  I'd say it gets the job done worse.  Why use two lines when you only need one?

-----------------------------------
Cervantes
Sun Oct 15, 2006 5:48 pm


-----------------------------------
Also, think about this: your way requires you to create another global variables. The number of global variables should be minimized as much as possible, to make things more organized and clean. This is just making it messier.

-----------------------------------
frank26080115
Mon Oct 16, 2006 5:18 pm


-----------------------------------
i find this works as a good "any key"


loop
exit when hasch
end loop


it pauses the program until a key is pressed

"getch" always shows a flashing black thing that i dont like, and you cant hide the window during "getch"

-----------------------------------
richcash
Mon Oct 16, 2006 5:58 pm


-----------------------------------
"getch" always shows a flashing black thing that i dont like, and you cant hide the window during "getch"
View.Set ("nocursor")

-----------------------------------
lordroba
Mon Oct 16, 2006 8:06 pm


-----------------------------------
hey, it's me again.  sorry, you guys were right, Input.Pause does work a lot better.  I had a bug in my code that was causing some undesired effects with Input.Pause before, so that's why I was hesitant to use it.  Anyways, thanks again. (and sorry if I came off as a little cocky before, my bad)

-----------------------------------
Andy
Thu Oct 19, 2006 3:05 am


-----------------------------------
i find this works as a good "any key"


loop
exit when hasch
end loop


it pauses the program until a key is pressed

"getch" always shows a flashing black thing that i dont like, and you cant hide the window during "getch"

if you dont have getch, then you can never use that hasch trick again because the character will remain in the buffer

-----------------------------------
Cervantes
Thu Oct 19, 2006 9:03 am


-----------------------------------
On the contrary, you can use the hasch trick again. You need Input.Flush
