Hi guys,

First of all please go easy on me, I'm very new to .c and have only been playing around for a few days, trying to customise some of the examples that come with the ARToolkit for augmented reality apps. My only previous programming experience has been messing about with similar stuff using Flash and Actionscript. So what I'm going to ask is probably really basic to most...

I have a program with a pyramid registered to a paper marker, and it rises when the Z key is pressed, up to a certain height, then starts from the beginning again. When the Z key is pressed again, the movement stops. But what I really want to do is have the movement take place when the key is down, but stop when it's released...

Here's the code I have at the moment:

Code:
static void Keyboard(unsigned char key, int x, int y)
{
	int mode;
	switch (key) {
		case 'Z':
		case 'z':
		      gDrawRise = !gDrawRise;
		break;
	}
}
All of the movements (gDrawRise) are handled in another function elsewhere, depending on whether it's true or false, so I guess what I'm looking for is some way of making it TRUE when 'Z' is down and FALSE when 'Z' is up? Any kind souls got any ideas on how I might be able to do this to help out a newbie??

Thanks