Author |
Message |
lordroba

|
Posted: Sat Oct 14, 2006 7:18 pm Post subject: 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 |
|
|
|
|
 |
Sponsor Sponsor

|
|
 |
Tony

|
|
|
|
 |
TokenHerbz

|
Posted: Sat Oct 14, 2006 11:01 pm Post subject: (No subject) |
|
|
|
|
|
|
|
 |
lordroba

|
Posted: Sun Oct 15, 2006 5:40 pm Post subject: (No subject) |
|
|
Actually I found that
code: | var ch : string (1)
getch (ch)
|
got the job done better. Thanks for the help guys  |
|
|
|
|
 |
[Gandalf]

|
Posted: Sun Oct 15, 2006 5:43 pm Post subject: (No subject) |
|
|
Why would you say that? I'd say it gets the job done worse. Why use two lines when you only need one? |
|
|
|
|
 |
Cervantes

|
Posted: Sun Oct 15, 2006 5:48 pm Post subject: (No subject) |
|
|
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
|
Posted: Mon Oct 16, 2006 5:18 pm Post subject: (No subject) |
|
|
i find this works as a good "any key"
code: |
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
|
Posted: Mon Oct 16, 2006 5:58 pm Post subject: (No subject) |
|
|
Quote: "getch" always shows a flashing black thing that i dont like, and you cant hide the window during "getch"
code: | View.Set ("nocursor") |
|
|
|
|
|
 |
Sponsor Sponsor

|
|
 |
lordroba

|
Posted: Mon Oct 16, 2006 8:06 pm Post subject: (No subject) |
|
|
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
|
Posted: Thu Oct 19, 2006 3:05 am Post subject: (No subject) |
|
|
frank26080115 wrote: i find this works as a good "any key"
code: |
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

|
Posted: Thu Oct 19, 2006 9:03 am Post subject: (No subject) |
|
|
On the contrary, you can use the hasch trick again. You need |
|
|
|
|
 |
|