Glut and key input.,
Members - Reputation: 338
Posted 08 October 2001 - 07:54 AM
Members - Reputation: 145
Posted 08 October 2001 - 03:39 PM
... and when a key is pressed, set its keyDown to be true (and inversely, when a key is released, set it to false).
Then, somewhere else (perhaps in an idle func or timer func), you check what keys are down at that given moment, and move your ship accordingly.
EDIT: you may also want to suppress key repeats (no point processing multiple keydown events)... but i can't remember how to do it off the top of my head... check the glut docs
Edited by - Bad Monkey on October 8, 2001 10:42:31 PM
EDIT (again): I just checked the docs myself, and it seems that my rusty memory has failed me again... there doesn't seem to be a way to determine when a key is released (only pressed). Must've been thinking about mouse buttons ...sorry about that
Edited by - Bad Monkey on October 9, 2001 9:40:51 AM