![]() |
|
A scanf/gets function |
CJ
Member #806
December 2000
|
I¡m trying to make a function like scanf or gets with Allegro, but I don't know well how to use the readkey() function, Has anybody an example of how to do this? Can I use getch() with Allegro? |
Omikron
Member #1,413
February 2001
|
Hmmm... interesting question, why don't you try and see what happens. |
amarillion
Member #940
January 2001
![]() |
There is an example of readkey in the allegro\examples directory. I don't remember what it is called. Anyway, readkey() just waits until the user presses a key, and then returns it. -- |
lwithers
Member #630
September 2000
|
Once you have called install_keyboard(), you will no longer be able to use getch(). If you are writing a console application, you won't be able to use install_keyboard() on several platforms since they must have a graphics window open to bind the keyboard to. |
CJ
Member #806
December 2000
|
Amarillion: Have you noted how returns the key readkey()? Look at the allegro docs and you will see what I mean, I don't know how to use the keys in those ways. |
CJ
Member #806
December 2000
|
Ok,I'm sorry, I didn't read the docs well before asking. This is the equivalent function to getch(): |
Marty Dill
Member #277
April 2000
![]() |
I have written code to do this ... if you want, I will post it. |
wit
Member #858
November 2000
![]() |
Hey CJ! WIT |
CJ
Member #806
December 2000
|
Yes, please post me those functions, I'll save some work and I'm very lazy. Thanks in advance. |
Marty Dill
Member #277
April 2000
![]() |
Here ya go ... nothing special, really. A few modifications would make it much more flexible. |
Bob
Free Market Evangelist
September 2000
![]() |
Here's mine: -- |
wit
Member #858
November 2000
![]() |
Hmm...here it is: return(txt); |
CJ
Member #806
December 2000
|
Thank you very much for your functions guys! |
|