Question, Please Help
- Posted by "M. Schut" <m.schut at TWI.TUDELFT.NL> May 28, 1999
- 397 views
> I see that the get_key() function allows for the program to get the next > key pressed without waiting. How do I assign that key's identity (a > numeric value I'm guessing) to a variable so that I can manipulate it? > > while get_key() = -1 do > bla bla bla > end while > > But how do I take whatever key was pressed and use it? > > -Phil Try the following code: integer key key = get_key() while key = -1 do key = get_key() end while printf(1, "The code of the key pressed was: %d", key) I hope I didn't make any mistakes since I haven't tested it! Bye, Martin Schut